Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run autoquant after compile #1466

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions examples/sam2_amg_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,9 +600,6 @@ def main(checkpoint_path,

if furious:
set_furious(mask_generator)
# since autoquant is replicating what furious mode is doing, don't use these two together
elif use_autoquant:
set_autoquant(mask_generator)

if save_fast != "":
assert load_fast == "", "Can't save compiled models while loading them with --load-fast."
Expand All @@ -614,6 +611,11 @@ def main(checkpoint_path,
assert not baseline, "--fast cannot be combined with baseline. code to be torch.compile(fullgraph=True) compatible."
set_fast(mask_generator, load_fast)

# since autoquant is replicating what furious mode is doing, don't use these two together
if use_autoquant:
assert not furious, "use autoquant can't be used together with furious"
set_autoquant(mask_generator)

with open('dog.jpg', 'rb') as f:
image_tensor = file_bytes_to_image_tensor(bytearray(f.read()))

Expand Down
Loading