From 4ea3b99591a053ef0dcb8e51234c74a4a8416d9c Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 16 Dec 2025 19:28:09 -0800 Subject: [PATCH 1/8] python3Packages.torchao: disable failing tests on aarch64-darwin --- pkgs/development/python-modules/torchao/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkgs/development/python-modules/torchao/default.nix b/pkgs/development/python-modules/torchao/default.nix index 48a8f34a9817..c2cf15e406f2 100644 --- a/pkgs/development/python-modules/torchao/default.nix +++ b/pkgs/development/python-modules/torchao/default.nix @@ -185,6 +185,19 @@ buildPythonPackage rec { # RuntimeError: quantized engine NoQEngine is not supported "test_smooth_linear_cpu" "test_smooth_linear_edge_cases" + + # TypeError: Trying to convert Float8_e4m3fn to the MPS backend but it does not have support for that dtype. + "test_subclass_slice_subclass2_shape0_device_mps" + "test_subclass_slice_subclass2_shape1_device_mps" + # torch._inductor.exc.InductorError: KeyError: torch.float8_e4m3fn + "test_optim_default_dtype_bf16_optim_name_AdamFp8_device_mps" + "test_optim_smoke_optim_name_AdamWFp8_bfloat16_device_mps" + "test_optim_smoke_optim_name_AdamWFp8_float32_device_mps" + "test_param_groups_optim_name_AdamFp8_device_mps" + "test_subclass_slice_subclass0_shape0_device_mps" + "test_optim_smoke_optim_name_AdamFp8_bfloat16_device_mps" + "test_optim_smoke_optim_name_AdamFp8_float32_device_mps" + "test_subclass_slice_subclass0_shape1_device_mps" ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ # Flaky: [gw0] node down: keyboard-interrupt From 31b3f2a72cb0da09ae3bb793a18e2bf520cdf7c4 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 16 Dec 2025 20:07:54 -0800 Subject: [PATCH 2/8] python3Packages.torchtune: run only the torchtune tests regression and recipies tests skipped. --- pkgs/development/python-modules/torchtune/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/torchtune/default.nix b/pkgs/development/python-modules/torchtune/default.nix index d205aa25f51d..df55b169f30c 100644 --- a/pkgs/development/python-modules/torchtune/default.nix +++ b/pkgs/development/python-modules/torchtune/default.nix @@ -85,6 +85,9 @@ buildPythonPackage rec { writableTmpDirAsHomeHook ]; + # Exclude `regression` which depends on a specific llama model and `recipies` which are sample code + enabledTestPaths = [ "tests/torchtune" ]; + disabledTests = [ # AssertionError (tensors are not equal) "test_stop_tokens" From 900597719ea94aa8ce13fbdc5688e49986cb4f8b Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 18 Dec 2025 12:32:15 -0800 Subject: [PATCH 3/8] python3Packages.torchtune: add sarahec as maintainer --- pkgs/development/python-modules/torchtune/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/torchtune/default.nix b/pkgs/development/python-modules/torchtune/default.nix index df55b169f30c..7e14bd087537 100644 --- a/pkgs/development/python-modules/torchtune/default.nix +++ b/pkgs/development/python-modules/torchtune/default.nix @@ -121,6 +121,9 @@ buildPythonPackage rec { homepage = "https://github.com/meta-pytorch/torchtune"; changelog = "https://github.com/meta-pytorch/torchtune/releases/tag/${src.tag}"; license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ GaetanLepage ]; + maintainers = with lib.maintainers; [ + GaetanLepage + sarahec + ]; }; } From afdf13c128f80879a366af442ddb998e759d5aad Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 16 Dec 2025 20:07:54 -0800 Subject: [PATCH 4/8] python3Packages.torchtune: disable tests that fail on Darwin --- .../python-modules/torchtune/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/development/python-modules/torchtune/default.nix b/pkgs/development/python-modules/torchtune/default.nix index 7e14bd087537..1fac454501f0 100644 --- a/pkgs/development/python-modules/torchtune/default.nix +++ b/pkgs/development/python-modules/torchtune/default.nix @@ -114,6 +114,21 @@ buildPythonPackage rec { ++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [ # Fatal Python error: Segmentation fault "test_forward_gqa" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # tests/torchtune/training/test_distributed.py + "test_init_from_env_no_dup" + "test_init_from_env_dup" + ]; + + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ + # fail due to floating-point precision differences + "tests/torchtune/models/flux/test_flux_autoencoder.py::TestFluxAutoencoder::test_encode" + "tests/torchtune/modules/peft/test_dora.py::TestDoRALinear::test_qdora_parity[True-dtype1]" + "tests/torchtune/modules/peft/test_lora.py::TestLoRALinear::test_qlora_parity[True-dtype1]" + + # hangs + "tests/torchtune/utils" ]; meta = { From a076e468b1d3ada7fd40eb14fa45360183e88475 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 18 Dec 2025 12:13:02 -0800 Subject: [PATCH 5/8] python3Packages.torchao: merge disabled tests that fail on aarch64 and x86_64 darwin --- pkgs/development/python-modules/torchao/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/torchao/default.nix b/pkgs/development/python-modules/torchao/default.nix index c2cf15e406f2..252b9183e9df 100644 --- a/pkgs/development/python-modules/torchao/default.nix +++ b/pkgs/development/python-modules/torchao/default.nix @@ -168,7 +168,7 @@ buildPythonPackage rec { "test_save_load_int8woqtensors_0_cpu" "test_save_load_int8woqtensors_1_cpu" ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + ++ lib.optionals stdenv.hostPlatform.isDarwin [ # AssertionError: Scalars are not equal! "test_comm" "test_fsdp2" @@ -176,8 +176,7 @@ buildPythonPackage rec { "test_precompute_bitnet_scale" "test_qlora_fsdp2" "test_uneven_shard" - ] - ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + # RuntimeError: No packed_weights_format was selected "TestIntxOpaqueTensor" "test_accuracy_kleidiai" @@ -206,7 +205,7 @@ buildPythonPackage rec { "test_int8_weight_only_quant_with_freeze_2_cpu" ]; - disabledTestPaths = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [ + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ # Require unpackaged 'coremltools' "test/prototype/test_groupwise_lowbit_weight_lut_quantizer.py" From dd81525292dfa6fb5646285e17edc552402295ff Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 18 Dec 2025 11:05:10 -0800 Subject: [PATCH 6/8] python3Packages.torchao: disable failing test on x86_64-darwin --- pkgs/development/python-modules/torchao/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/python-modules/torchao/default.nix b/pkgs/development/python-modules/torchao/default.nix index 252b9183e9df..8100f1ba355e 100644 --- a/pkgs/development/python-modules/torchao/default.nix +++ b/pkgs/development/python-modules/torchao/default.nix @@ -203,6 +203,9 @@ buildPythonPackage rec { "test_int8_weight_only_quant_with_freeze_0_cpu" "test_int8_weight_only_quant_with_freeze_1_cpu" "test_int8_weight_only_quant_with_freeze_2_cpu" + + # Illegal instruction in subclass_4bit.py::dequantize + "test_subclass_slice" ]; disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ From 5f095d936ef8fc235590f0194a464725f567dc7f Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Thu, 18 Dec 2025 11:09:20 -0800 Subject: [PATCH 7/8] python3Packages.torchao: add sarahec as maintainer --- pkgs/development/python-modules/torchao/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/torchao/default.nix b/pkgs/development/python-modules/torchao/default.nix index 8100f1ba355e..b74d56ae8e0b 100644 --- a/pkgs/development/python-modules/torchao/default.nix +++ b/pkgs/development/python-modules/torchao/default.nix @@ -223,6 +223,9 @@ buildPythonPackage rec { homepage = "https://github.com/pytorch/ao"; changelog = "https://github.com/pytorch/ao/releases/tag/v${version}"; license = lib.licenses.bsd3; - maintainers = with lib.maintainers; [ GaetanLepage ]; + maintainers = with lib.maintainers; [ + GaetanLepage + sarahec + ]; }; } From 0aaf28fa51e7e3dcee3c5853047df36f100532c8 Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Tue, 23 Dec 2025 13:54:53 -0800 Subject: [PATCH 8/8] python3Packages.executorch: disable on Darwin --- pkgs/development/python-modules/executorch/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/executorch/default.nix b/pkgs/development/python-modules/executorch/default.nix index f75dd5dae36d..9013410fb89d 100644 --- a/pkgs/development/python-modules/executorch/default.nix +++ b/pkgs/development/python-modules/executorch/default.nix @@ -200,6 +200,8 @@ buildPythonPackage rec { badPlatforms = [ # Many tests segfault. Supporting this platform will need additional work "aarch64-linux" + # Compilation errors on Darwin + lib.systems.inspect.patterns.isDarwin ]; }; }