Skip to content

fix/rocm properties export#487

Merged
danieldk merged 4 commits into
huggingface:mainfrom
GitGlimpse895:fix/rocm-properties-export
May 19, 2026
Merged

fix/rocm properties export#487
danieldk merged 4 commits into
huggingface:mainfrom
GitGlimpse895:fix/rocm-properties-export

Conversation

@GitGlimpse895
Copy link
Copy Markdown
Contributor

ROCMProperties was fully implemented in device.py with its own docstring and example, but was never wired up end-to-end:

  • Device.properties was typed as CUDAProperties | None, silently rejecting ROCMProperties at the type-system level.
  • Device.__post_init__ validated CUDAProperties placement but had no symmetric guard for ROCMProperties, allowing invalid combinations like Device(type="cuda", properties=ROCMProperties(...)) to pass silently.
  • ROCMProperties was never exported from kernels/layer/__init__.py or the top-level kernels/__init__.py, making from kernels import ROCMProperties fail despite being shown in the class docstring example.

This PR fixes all three gaps across three files, completing the ROCm capability-range kernel selection feature that was already wired up in _ROCMRepos.

@GitGlimpse895 GitGlimpse895 force-pushed the fix/rocm-properties-export branch 4 times, most recently from 65ef442 to ae0a6eb Compare April 23, 2026 01:42
@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.

@GitGlimpse895 GitGlimpse895 force-pushed the fix/rocm-properties-export branch from 441d889 to f98c3ec Compare April 23, 2026 13:15
@GitGlimpse895 GitGlimpse895 force-pushed the fix/rocm-properties-export branch from f98c3ec to 4da11a4 Compare May 8, 2026 02:36
@GitGlimpse895
Copy link
Copy Markdown
Contributor Author

Hey @sayakpaul — wanted to get your eyes on this if you have a moment! This PR wires up ROCMProperties end-to-end — fixes the type annotation on Device.properties, adds a symmetric validation guard in __post_init__, and exports ROCMProperties from both kernels/layer/__init__.py and the top-level kernels/__init__.py. It's a pretty contained fix, but curious what you think — does this approach look right to you, or would you handle the validation guard differently?

@danieldk danieldk force-pushed the fix/rocm-properties-export branch from 4da11a4 to 230fa2e Compare May 19, 2026 13:24
Copy link
Copy Markdown
Member

@danieldk danieldk left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! Sorry for the delay.

@danieldk danieldk merged commit 8941f82 into huggingface:main May 19, 2026
59 of 60 checks passed
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