Skip to content

Avoid calling get_max_length - #34971

Merged
ydshieh merged 1 commit into
mainfrom
fix_compile_2
Nov 27, 2024
Merged

Avoid calling get_max_length#34971
ydshieh merged 1 commit into
mainfrom
fix_compile_2

Conversation

@ydshieh

@ydshieh ydshieh commented Nov 27, 2024

Copy link
Copy Markdown
Collaborator

What does this PR do?

Some tests are failing after #34247 as they are calling get_max_length which calls logger, and torch dynamo hate it with

torch._dynamo.exc.Unsupported: Logger not supported for non-export cases

Let's just call get_max_cache_shape as get_max_length is just logger + get_max_cache_shape

PaliGemmaForConditionalGenerationModelTest::test_generate_with_static_cache and tests/models/granite/test_modeling_granite.py::GraniteModelTest::test_generate_from_inputs_embeds_with_static_cache are passing now but

GraniteMoeModelTest::test_generate_from_inputs_embeds_with_static_cache

still has data dependent operation issue and failed. That should be addressed in a separate PR.

@ydshieh
ydshieh requested a review from ArthurZucker November 27, 2024 14:08
@ydshieh

ydshieh commented Nov 27, 2024

Copy link
Copy Markdown
Collaborator Author

PaliGemmaForConditionalGenerationModelTest::test_generate_with_static_cache

Might be flaky (1 failed in 100 run in my last check). I will look at this but open another PR for it.

@ArthurZucker ArthurZucker left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫡 thanks for adressing!

@ydshieh
ydshieh merged commit 0d99a93 into main Nov 27, 2024
@ydshieh
ydshieh deleted the fix_compile_2 branch November 27, 2024 14:15
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

BernardZach pushed a commit to BernardZach/transformers that referenced this pull request Dec 5, 2024
fix

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

3 participants