Skip to content

Commit 539cb19

Browse files
mikekgfbmalfet
authored andcommitted
handle device=mps when loading DSOs by issuing warning and loading cpu model (#731)
1 parent b5c464a commit 539cb19

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

build/builder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ def _initialize_model(
381381
print(f"Time to load model: {time.time() - t0:.02f} seconds")
382382

383383
try:
384+
if "mps" in builder_args.device:
385+
print("Warning: MPS currently does not support DSO models. Trying to load for CPU.")
386+
builder_args.device = "cpu"
387+
384388
# Replace model forward with the AOT-compiled forward
385389
# This is a hacky way to quickly demo AOTI's capability.
386390
# model is still a Python object, and any mutation to its

0 commit comments

Comments
 (0)