Skip to content
This repository was archived by the owner on Apr 6, 2026. It is now read-only.

Restructure extension to cache extra ROCm and XPU dependencies#257

Merged
danieldk merged 2 commits into
mainfrom
cache-extra-deps
Oct 14, 2025
Merged

Restructure extension to cache extra ROCm and XPU dependencies#257
danieldk merged 2 commits into
mainfrom
cache-extra-deps

Conversation

@danieldk
Copy link
Copy Markdown
Member

Before this change the torch-extension directory was just a derivation that built an extension for a given configuration + build set. The downside of this approach was that we could not easily get things like

  • The standard environment to be used by dev shells.
  • Overrides for caching. For instance, we override ROCm's clr and XPU's oneapi-torch-dev and onednn-xpu to use stdenv with an old glibc.

This change modifies torch-extension so that we can instantiate it given a build set. A set is returned that can give access to the things mentioned above, as well as mkExtension and mkNoArchExtension functions. We assign this set to the corresponding build set, so that it is directly accessible from the build set.

Use this change to add ROCm and XPU overrides to the cache.

Before this change the `torch-extension` directory was just a derivation
that built an extension for a given configuration + build set. The
downside of this approach was that we could not easily get things like

- The standard environment to be used by dev shells.
- Overrides for caching. For instance, we override ROCm's `clr` and
  XPU's `oneapi-torch-dev` and `onednn-xpu` to use stdenv with an
  old glibc.

This change modifies `torch-extension` so that we can instantiate it
given a build set. A set is returned that can give access to the things
mentioned above, as well as mkExtension and mkNoArchExtension functions.
We assign this set to the corresponding build set, so that it is
directly accessible from the build set.
Copy link
Copy Markdown
Contributor

@MekkCyber MekkCyber left a comment

Choose a reason for hiding this comment

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

Really nice refactor!

kernel-abi-check,
python3,
rewrite-nix-paths-macho,
stdenvGlibc_2_27,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is this a minimal requirement or a strict requirement ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We target this version because it was what Torch itself is compiled against (or at least Torch 2.5 or 2.6), it results on working on any glibc version >= 2.27.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

perfect

@danieldk danieldk merged commit cd39ed6 into main Oct 14, 2025
28 checks passed
@danieldk danieldk deleted the cache-extra-deps branch October 14, 2025 07:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants