Torch-bin depends on triton

When trying to allow the unfree package torch-bin using allowUnfreePredicate, I need to add triton to the whitelist.

The package description for triton is

TritonDataCenter Client CLI and Node.js SDK

Does torch-bin really need to depend on this?

Furthermore, after whitelisting

  • triton
  • cuda_cudart
  • cuda_nvtx
  • torch

I get a working pytorch-bin on my development machine (linux x86-64) but CI fails on x86_64-apple-darwin with

error: Package ‘python3.11-triton-2.0.0’ in /nix/store/lnbafzxw52r0w55hwbcrsdkvk5fymv3l-source/pkgs/development/python-modules/openai-triton/bin.nix:70 is not available on the requested hostPlatform:
         hostPlatform.config = "x86_64-apple-darwin"
         package.meta.platforms = [

What’s even more confusing is that even though x86_64-linux is the only supported platform, I’ve had a user report success in using torch-bin on an M2 Mac (when using a blunt config.allowUnfree = true;).

Also, where does the above definition of package.meta.platforms come from? I can’t see it in the nixpkgs derivation for triton.

There are unrelated packages with pname = “triton”

It seems that triton refers to

rather than

and both have the same pname.

Difference between M2 Mac and x86 Mac

It works on Apple Silicon, because torch-bin only depends on openai-triton on x86_64:

platform definition

It comes from here

Note that this is openai-triton/bin.nix, not openai-triton/default.nix, both of which are unrelated to pkgs/tools/admin/triton.