Skip to content

Update Readme #1526

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

Merged
merged 1 commit into from
May 22, 2025
Merged

Update Readme #1526

merged 1 commit into from
May 22, 2025

Conversation

drisspg
Copy link
Contributor

@drisspg drisspg commented Jan 8, 2025

Stacked PRs:


Update Readme

Copy link

pytorch-bot bot commented Jan 8, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/1526

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

drisspg added a commit that referenced this pull request Jan 8, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 8, 2025
@drisspg drisspg added the topic: documentation Use this tag if this PR adds or improves documentation label Jan 8, 2025
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request Jan 15, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
@bhack
Copy link

bhack commented Feb 1, 2025

Can we expand also few lines on autoquant that currently it is really a single line in the Readme?

E.g. I see some basic option here that it would nice to clarify as a basic use case:

def set_autoquant(mask_generator, autoquant_type, min_sqnr):
import torchao
from torchao import autoquant
# NOTE: Not baseline feature
if autoquant_type == "autoquant":
mask_generator.predictor.model.image_encoder = autoquant(
mask_generator.predictor.model.image_encoder, min_sqnr=min_sqnr
)
elif autoquant_type == "autoquant-fp":
mask_generator.predictor.model.image_encoder = autoquant(
mask_generator.predictor.model.image_encoder,
qtensor_class_list=torchao.quantization.DEFAULT_FLOAT_AUTOQUANT_CLASS_LIST,
min_sqnr=min_sqnr,
)
elif autoquant_type == "autoquant-all":
mask_generator.predictor.model.image_encoder = autoquant(
mask_generator.predictor.model.image_encoder,
qtensor_class_list=torchao.quantization.ALL_AUTOQUANT_CLASS_LIST,
min_sqnr=min_sqnr,
)
else:
raise ValueError(f"Unexpected autoquant type: {autoquant_type}")
mask_generator.predictor._transforms_device = mask_generator.predictor.device
torch.set_float32_matmul_precision("high")
# NOTE: this fails when we run
# python server.py ~/checkpoints/sam2 large --port 8000 --host localhost --fast --autoquant_type autoquant --unittest
# https://gist.github.com/jerryzh168/d337cb5de0a1dec306069fe48ac8225e
# mask_generator.predictor.model.sam_mask_decoder = autoquant(mask_generator.predictor.model.sam_mask_decoder, qtensor_class_list=DEFAULT_FLOAT_AUTOQUANT_CLASS_LIST, min_sqnr=40)

drisspg added a commit that referenced this pull request Feb 5, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
drisspg added a commit that referenced this pull request May 21, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
@drisspg drisspg force-pushed the drisspg/stack/24 branch from d6a6302 to 040b392 Compare May 21, 2025 21:46
drisspg added a commit that referenced this pull request May 21, 2025
stack-info: PR: #1526, branch: drisspg/stack/24
@drisspg drisspg force-pushed the drisspg/stack/24 branch from 040b392 to 53d40cd Compare May 21, 2025 21:50
Copy link
Contributor

@supriyar supriyar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a few comments, please review. Overall looks much better!

stack-info: PR: #1526, branch: drisspg/stack/24
@drisspg drisspg force-pushed the drisspg/stack/24 branch from 53d40cd to 5507195 Compare May 22, 2025 17:23
@drisspg drisspg merged commit adc78b7 into main May 22, 2025
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. topic: documentation Use this tag if this PR adds or improves documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants