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

Select default shells from available variants#247

Merged
danieldk merged 1 commit into
mainfrom
select-available-shell
Oct 9, 2025
Merged

Select default shells from available variants#247
danieldk merged 1 commit into
mainfrom
select-available-shell

Conversation

@danieldk
Copy link
Copy Markdown
Member

@danieldk danieldk commented Oct 8, 2025

Before this change, nix develop and nix develop .#test would use the torch28-metal-aarch64-darwin or torch28-cxx11-cu126-${system} build variants on macOS or Linux respectively. This had two downsides: (1) it resulted in an error for ROCm/XPU-only kernels, requiring to manually specify the variant; (2) we had to maintain the variants (e.g. bump up the Torch version when 2.8 is not supported anymore).

This change chooses the shell depending on the variants that are available for a given kernel on a given system. We use the following ordering to sort the available variants:

  • Bundle variants before non-bundle variants.
  • CUDA variants before other frameworks.
  • Newer Torch versions before older versions.
  • Older frameworks before newer (best system compatibility).

Then we choose the first variant in this ordering. This should select the best variant in most cases.

Before this change, `nix develop` and `nix develop .#test` would use
the `torch28-metal-aarch64-darwin` or `torch28-cxx11-cu126-${system}`
build variants on macOS or Linux respectively. This had two downsides:
(1) it resulted in an error for ROCm/XPU-only kernels, requiring to
manually specify the variant; (2) we had to maintain the variants
(e.g. bump up the Torch version when 2.8 is not supported anymore).

This change chooses the shell depending on the variants that are
available for a given kernel on a given system. We use the following
ordering to sort the available variants:

- Bundle variants before non-bundle variants.
- CUDA variants before other frameworks.
- Newer Torch versions before older versions.
- Older frameworks before newer (best system compatibility).

Then we choose the first variant in this ordering. This should select
the best variant in most cases.
Comment thread lib/gen-flake-outputs.nix
bundleOnly = false;
rev = revUnderscored;
};
buildTree =
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.

This output has been broken for a while, so I don't think anyone uses it. IIRC it precedes shell support, it's more convenient to nix develop now and build2cmake there.

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.

LGTM

@danieldk danieldk merged commit 378524d into main Oct 9, 2025
27 checks passed
@danieldk danieldk deleted the select-available-shell branch October 9, 2025 07:35
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