Skip to content

remove the set_inductor_config argument of quantize_. #1865

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 96 commits into from
Mar 12, 2025
Merged

Conversation

vkuzo
Copy link
Contributor

@vkuzo vkuzo commented Mar 10, 2025

Summary:

Finishing the migration in #1715. Specifically:

  • the set_inductor_config argument of quantize_ is removed
  • the following workflows get a set_inductor_config argument, defaulting to True: AWQUIntXConfig, IntNWeightOnlyConfig, SmoothQuantConfig, Int8DynamicActivationInt4WeightConfig, Int4DynamicActivationInt4WeightConfig, GemliteUIntXWeightOnlyConfig, Int4WeightOnlyConfig, Int8WeightOnlyConfig, Int8DynamicActivationInt8WeightConfig, Float8WeightOnlyConfig, Float8DynamicActivationFloat8WeightConfig, Float8DynamicActivationFloat8WeightConfig, Float8StaticActivationFloat8WeightConfig, Float8StaticActivationFloat8WeightConfig, UIntXWeightOnlyConfig, FPXWeightOnlyConfig. I skipped quantized training and non-AQT workflows from this, since I expect them to not need this setting.

Before

def quantize_(
    model: torch.nn.Module,
    config: AOBaseConfig,
    filter_fn: Optional[Callable[[torch.nn.Module, str], bool]] = None,
    set_inductor_config: Optional[bool] = None,
    device: Optional[torch.types.Device] = None,
):  ...

After

def quantize_(
    model: torch.nn.Module,
    config: AOBaseConfig,
    filter_fn: Optional[Callable[[torch.nn.Module, str], bool]] = None,
    device: Optional[torch.types.Device] = None,
):  ...

# see top of PR description for list of affected configs
class Int8DynamicActivationInt4WeightConfig(AOBaseConfig):
    ...
    set_inductor_config: bool = True

Test Plan:

pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics

Reviewers:

Subscribers:

Tasks:

Tags:

vkuzo added 30 commits March 7, 2025 06:48
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added 6 commits March 12, 2025 10:17
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 12, 2025
Summary:

Test Plan:

```
pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e6694cc
ghstack-comment-id: 2712016215
Pull Request resolved: #1865
vkuzo added 5 commits March 12, 2025 13:56
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 12, 2025
Summary:

Test Plan:

```
pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e6694cc
ghstack-comment-id: 2712016215
Pull Request resolved: #1865
vkuzo added 4 commits March 12, 2025 13:57
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 12, 2025
Summary:

Test Plan:

```
pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e6694cc
ghstack-comment-id: 2712016215
Pull Request resolved: #1865
vkuzo added 3 commits March 12, 2025 13:58
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 12, 2025
Summary:

Test Plan:

```
pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e6694cc
ghstack-comment-id: 2712016215
Pull Request resolved: #1865
vkuzo added 2 commits March 12, 2025 13:59
[ghstack-poisoned]
[ghstack-poisoned]
vkuzo added a commit that referenced this pull request Mar 12, 2025
Summary:

Test Plan:

```
pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e6694cc
ghstack-comment-id: 2712016215
Pull Request resolved: #1865
[ghstack-poisoned]
@vkuzo vkuzo changed the base branch from gh/vkuzo/64/head to main March 12, 2025 20:59
vkuzo added a commit that referenced this pull request Mar 12, 2025
Summary:

Test Plan:

```
pytest test/quantization/test_quant_api.py -s -x -k test_workflow_e2e_numerics
```

Reviewers:

Subscribers:

Tasks:

Tags:

ghstack-source-id: e6694cc
ghstack-comment-id: 2712016215
Pull Request resolved: #1865
@vkuzo vkuzo merged commit 0eea64a into main Mar 12, 2025
8 of 9 checks passed
tfqaprod pushed a commit to intel/ai-reference-models that referenced this pull request Mar 13, 2025
…h (#2681)

In pytorch/ao#1865, torchao removed `set_inductor_config` argument from `torchao.quantization.quant_api.quantize_`

Co-authored-by: Srikanth Ramakrishna <srikanth.ramakrishna@intel.com>
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: bc-breaking Use this tag if this PR breaks backward compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants