From ab06b3bd6c52ba83a0131865820f1a8e695b33be Mon Sep 17 00:00:00 2001 From: Mika Tammi Date: Sat, 2 Nov 2024 18:54:21 +0200 Subject: [PATCH 1/3] python3Packages.accelerate: Add huggingface-hub Add huggingface-hub to the dependencies, this should fix various import errors. Signed-off-by: Mika Tammi --- pkgs/development/python-modules/accelerate/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/accelerate/default.nix b/pkgs/development/python-modules/accelerate/default.nix index bcbd29bcc963..70c5ac7822c1 100644 --- a/pkgs/development/python-modules/accelerate/default.nix +++ b/pkgs/development/python-modules/accelerate/default.nix @@ -12,6 +12,7 @@ setuptools, # dependencies + huggingface-hub, numpy, packaging, psutil, @@ -45,6 +46,7 @@ buildPythonPackage rec { build-system = [ setuptools ]; dependencies = [ + huggingface-hub numpy packaging psutil From db21952673992c4d5a91154eb7d64039dc2f9f9c Mon Sep 17 00:00:00 2001 From: Mika Tammi Date: Sat, 2 Nov 2024 18:55:46 +0200 Subject: [PATCH 2/3] python3Packages.accelerate: 1.0.0 -> 1.1.0 Signed-off-by: Mika Tammi --- pkgs/development/python-modules/accelerate/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/accelerate/default.nix b/pkgs/development/python-modules/accelerate/default.nix index 70c5ac7822c1..54c29b54280e 100644 --- a/pkgs/development/python-modules/accelerate/default.nix +++ b/pkgs/development/python-modules/accelerate/default.nix @@ -31,14 +31,14 @@ buildPythonPackage rec { pname = "accelerate"; - version = "1.0.0"; + version = "1.1.0"; pyproject = true; src = fetchFromGitHub { owner = "huggingface"; repo = "accelerate"; rev = "refs/tags/v${version}"; - hash = "sha256-XVJqyhDSUPQDHdaB6GDxHhuC6EWCSZNArjzyLpvhQHI="; + hash = "sha256-GBNe4zomy8dmfvYrk/9Q77Z6r+JJA+2dgAhJx2opqAc="; }; buildInputs = [ llvmPackages.openmp ]; From f28e7aaed04b56f138fe3a13c13e835036d2a8dc Mon Sep 17 00:00:00 2001 From: Mika Tammi Date: Sat, 2 Nov 2024 19:35:07 +0200 Subject: [PATCH 3/3] python3Packages.accelerate: disable some tests darwin: Disable some tests, which started failing after enabling MPS in pytorch package. Signed-off-by: Mika Tammi --- .../python-modules/accelerate/default.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkgs/development/python-modules/accelerate/default.nix b/pkgs/development/python-modules/accelerate/default.nix index 54c29b54280e..ea8efbcad1b1 100644 --- a/pkgs/development/python-modules/accelerate/default.nix +++ b/pkgs/development/python-modules/accelerate/default.nix @@ -115,6 +115,31 @@ buildPythonPackage rec { "test_init_trackers" "test_log" "test_log_with_tensor" + + # After enabling MPS in pytorch, these tests started failing + "test_accelerated_optimizer_step_was_skipped" + "test_auto_wrap_policy" + "test_autocast_kwargs" + "test_automatic_loading" + "test_backward_prefetch" + "test_can_resume_training" + "test_can_resume_training_checkpoints_relative_path" + "test_can_resume_training_with_folder" + "test_can_unwrap_model_fp16" + "test_checkpoint_deletion" + "test_cpu_offload" + "test_cpu_ram_efficient_loading" + "test_grad_scaler_kwargs" + "test_invalid_registration" + "test_map_location" + "test_mixed_precision" + "test_mixed_precision_buffer_autocast_override" + "test_project_dir" + "test_project_dir_with_config" + "test_sharding_strategy" + "test_state_dict_type" + "test_with_save_limit" + "test_with_scheduler" ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ # RuntimeError: torch_shm_manager: execl failed: Permission denied