Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit 9420f4e

Browse files
authored
bandaid for run-readme-pr-macos.yml incorrectly loading to MPS
as per #1416 torchchat on hosts without MPS (which is all github hosts which use kvm to virtualize MacOS, but not MPS) should choose CPU as "fast" device. The logic is present (see discussion in #1416 ), but either not fully functional (that would be the easier one to fix, just print the result of get_device_str and fix the code!) or specifically ignored on load in torch/serialization.py (If this is the case, we're effectively looking at a core PyTorch issue....) In the meantime, this bandaid just forces the use of CPU on MacOS tests, to make MacOS tests run on CPU -- labeit hsortcircuiting test/execution of the "fast" device logic. Not ideal, but some testing beats no testing.
1 parent 4fdbe10 commit 9420f4e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/run-readme-pr-macos.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
sysctl machdep.cpu.core_count
3434
echo "::endgroup::"
3535
36-
.ci/scripts/run-docs readme
36+
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs readme
3737
3838
echo "::group::Completion"
3939
echo "tests complete"
@@ -68,7 +68,7 @@ jobs:
6868
sysctl machdep.cpu.core_count
6969
echo "::endgroup::"
7070
71-
.ci/scripts/run-docs quantization
71+
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs quantization
7272
7373
echo "::group::Completion"
7474
echo "tests complete"
@@ -103,7 +103,7 @@ jobs:
103103
sysctl machdep.cpu.core_count
104104
echo "::endgroup::"
105105
106-
.ci/scripts/run-docs gguf
106+
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs gguf
107107
108108
echo "::group::Completion"
109109
echo "tests complete"
@@ -137,7 +137,7 @@ jobs:
137137
sysctl machdep.cpu.core_count
138138
echo "::endgroup::"
139139
140-
.ci/scripts/run-docs advanced
140+
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs advanced
141141
142142
echo "::group::Completion"
143143
echo "tests complete"

0 commit comments

Comments
 (0)