Skip to content

Conversation

@nikita-savelyevv
Copy link
Collaborator

What does this PR do?

cache_position input is required to run inference. Needed for enabling data-aware quantization of Mamba model openvinotoolkit/nncf#3725 .

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@HuggingFaceDocBuilderDev

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.

@rkazants rkazants added the openvino-slow Runs OpenVINO slow tests with different versions of transformers label Nov 12, 2025
Comment on lines +1307 to +1310
if kwargs.get("past_key_values") is not None:
raise ValueError("`past_key_values` input is not supported for `OVModelWithMambaForCausalLM`")
if kwargs.get("position_ids") is not None:
raise ValueError("`position_ids` input is not supported for `OVModelWithMambaForCausalLM`")
Copy link
Member

Choose a reason for hiding this comment

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

is this really needed ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My motivation was to avoid possible confusion if anyone passes these arguments because parent's definition of prepare_inputs() has these arguments in its signature.

Copy link
Member

Choose a reason for hiding this comment

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

hmm i'm honestly not sure why this function is public, imo it should be private (it serves one purpose, an internal one)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Member

@IlyasMoutawwakil IlyasMoutawwakil Nov 13, 2025

Choose a reason for hiding this comment

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

that's still internal though 😅.. what i mean is that it shouldn't be used by a user
the downside of a public method is that we need to maintain its behaviour and only change it through deprecation process (over multiple versions).

@IlyasMoutawwakil IlyasMoutawwakil merged commit 906008d into main Nov 13, 2025
26 of 30 checks passed
@IlyasMoutawwakil IlyasMoutawwakil deleted the ns/add-cache-position branch November 13, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

openvino-slow Runs OpenVINO slow tests with different versions of transformers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants