Skip to content

Commit

Permalink
Force run-readme-pr-macos.yml to use CPU instead of incorrectly loadi…
Browse files Browse the repository at this point in the history
…ng to MPS (#1417)

* 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.

* Update run-readme-pr-macos.yml

Add informational message to MacOS CPU tests

* Update build_native.sh

Update to C++11 ABI for AOTI, similar to ET

---------

Co-authored-by: Jack-Khuu <[email protected]>
  • Loading branch information
mikekgfb and Jack-Khuu authored Jan 24, 2025
1 parent 24fd441 commit 9686c79
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/run-readme-pr-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
sysctl machdep.cpu.core_count
echo "::endgroup::"
.ci/scripts/run-docs readme
echo "using workaround for #1416 and #1315 by setting torchchat device explicitly"
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs readme
echo "::group::Completion"
echo "tests complete"
Expand Down Expand Up @@ -68,7 +69,8 @@ jobs:
sysctl machdep.cpu.core_count
echo "::endgroup::"
.ci/scripts/run-docs quantization
echo "using workaround for #1416 and #1315 by setting torchchat device explicitly"
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs quantization
echo "::group::Completion"
echo "tests complete"
Expand Down Expand Up @@ -103,7 +105,8 @@ jobs:
sysctl machdep.cpu.core_count
echo "::endgroup::"
.ci/scripts/run-docs gguf
echo "using workaround for #1416 and #1315 by setting torchchat device explicitly"
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs gguf
echo "::group::Completion"
echo "tests complete"
Expand Down Expand Up @@ -137,7 +140,8 @@ jobs:
sysctl machdep.cpu.core_count
echo "::endgroup::"
.ci/scripts/run-docs advanced
echo "using workaround for #1416 and #1315 by setting torchchat device explicitly"
TORCHCHAT_DEVICE=cpu .ci/scripts/run-docs advanced
echo "::group::Completion"
echo "tests complete"
Expand Down

0 comments on commit 9686c79

Please sign in to comment.