Skip to content

Handle submodule buffers when split in infer_auto_device_map#3957

Open
dg845 wants to merge 1 commit intohuggingface:mainfrom
dg845:fix-buffer-auto-placement
Open

Handle submodule buffers when split in infer_auto_device_map#3957
dg845 wants to merge 1 commit intohuggingface:mainfrom
dg845:fix-buffer-auto-placement

Conversation

@dg845
Copy link

@dg845 dg845 commented Mar 5, 2026

What does this PR do?

This PR modifies infer_auto_device_map to handle buffers when splitting a submodule. In the current code, only submodules and named parameters are considered.

Fixes #3956

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

@BenjaminBossan
@SunMarc

Copy link
Member

@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

Let's maybe also add a test?

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.

infer_auto_device_map does not place submodule buffers on device_map when submodule is split

2 participants