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

[torchlib] Implement quantize/dequantize operators #1732

Merged
merged 8 commits into from
Jul 18, 2024

Conversation

justinchuby
Copy link
Collaborator

@justinchuby justinchuby commented Jul 17, 2024

Initial implementations for the quantization operators defined in https://github.com/pytorch/pytorch/blob/main/torch/ao/quantization/fx/_decomposed.py. Related: pytorch/pytorch#106748

I created a new module called quantized_decomposed.py to host all ops that are defined under the quantized_decomposed namespace seen in pytorch/pytorch#106748. I created functions for the most common linear quantize/dequantize operators.

  • Also updates FunctionType -> Callable in decorators to make them play well with type checkers

Copy link

codecov bot commented Jul 17, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 74.63%. Comparing base (d05d101) to head (e1e02bb).
Report is 1 commits behind head on main.

Files Patch % Lines
...unction_libs/torch_lib/ops/quantized_decomposed.py 80.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1732      +/-   ##
==========================================
- Coverage   74.89%   74.63%   -0.26%     
==========================================
  Files         244      245       +1     
  Lines       26353    26360       +7     
  Branches     4791     4791              
==========================================
- Hits        19738    19675      -63     
- Misses       5694     5755      +61     
- Partials      921      930       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jul 17, 2024

Test Results

     24 files  ±     0      24 suites  ±0   1h 56m 56s ⏱️ - 4m 39s
 13 889 tests +   990  10 587 ✅ +  811    3 300 💤 +   179   2 ❌ ±0 
293 280 runs   - 17 583  71 200 ✅  - 2 581  222 070 💤  - 15 002  10 ❌ ±0 

For more details on these failures, see this check.

Results for commit f600925. ± Comparison against base commit f8ee736.

♻️ This comment has been updated with latest results.

@justinchuby justinchuby merged commit b043acf into main Jul 18, 2024
29 of 41 checks passed
@justinchuby justinchuby deleted the justinchu/quantization branch July 18, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: torch_lib Related to the torch/aten function lib in development
Projects
Development

Successfully merging this pull request may close these issues.

2 participants