Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caching Mechanism for choosing skip branch #39

Open
Kyuseok-nam opened this issue Apr 23, 2024 · 1 comment
Open

Caching Mechanism for choosing skip branch #39

Kyuseok-nam opened this issue Apr 23, 2024 · 1 comment

Comments

@Kyuseok-nam
Copy link

Kyuseok-nam commented Apr 23, 2024

Hi, I was going over the code for DeepCache and was quite confused with a particular part of the code where you choose the skip branch in the unet model.

from unet_2d_condition.py file, line 1102~1108, Why did you implment this if condition? it seems to limit access of other skip branch or layers.

Also if I'm understanding correctly,
Cache_layer_id : indicates which big block to choose from ex) CrossAttn2Dblock, DownBlock2D,...
Cache_block_id: indicates which block (small blocks inside the big block) to choose from ex) transformer2dmodel, resnet

is this correct?

스크린샷 2024-04-23 172624

@horseee
Copy link
Owner

horseee commented Jun 3, 2024

Hi, it's because of the mismatch of the down block and the up block.

The cache_block_id/cache_layer_id we use here is used in the downsampling block/layer. However, the downsampling block and upsampling block that are connected by the skip branch didn't share the same layer_id/block_id. Thus, this part of code functions like a layer/block mapping, and the goal is to find the corresponding layer/block id for this skip branch in the upsampling process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants