Skip to content
New issue

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

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

Already on GitHub? # to your account

Recursion error in QuantizationSimModel #3532

Open
DongGeun123 opened this issue Nov 26, 2024 · 1 comment
Open

Recursion error in QuantizationSimModel #3532

DongGeun123 opened this issue Nov 26, 2024 · 1 comment
Labels
aimet-torch New feature or bug fix for AIMET PyTorch

Comments

@DongGeun123
Copy link

Traceback (most recent call last):
model_quantizer.prepare_quantsim(dummy_input, args, dataset_builder.train_dataloader, tokenizer)
self.create_quantsim(dummy_input=dummy_input)
QuantizationSimModel(
File "/usr/local/lib/python3.10/dist-packages/aimet_torch/quantsim.py", line 267, in init
quantsim_configurator = self.configure_quantization_ops(config_file, default_output_bw, default_param_bw,
File "/usr/local/lib/python3.10/dist-packages/aimet_torch/quantsim.py", line 1602, in configure_quantization_ops
return QuantSimConfigurator(self.model, self.connected_graph, config_file, default_output_bw,
File "/usr/local/lib/python3.10/dist-packages/aimet_torch/quantsim_config/quantsim_config.py", line 127, in init
self._set_quantsim_configs()
File "/usr/local/lib/python3.10/dist-packages/aimet_common/quantsim_config/quantsim_config.py", line 159, in _set_quantsim_configs
self._set_supergroup_configs(self._quantsim_configs[ConfigDictKeys.SUPERGROUPS])
File "/usr/local/lib/python3.10/dist-packages/aimet_torch/quantsim_config/quantsim_config.py", line 510, in _set_supergroup_configs
conv_bn_pairs = find_scale_foldable_bns(self._conn_graph)
File "/usr/local/lib/python3.10/dist-packages/aimet_torch/quantsim_config/quantsim_config.py", line 507, in find_scale_foldable_bns
graph_searcher.find_all_patterns_in_graph_apply_actions()
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_searcher.py", line 206, in find_all_patterns_in_graph_apply_actions
GraphSearcher._find_patterns_apply_actions(self, op, pattern_matcher,
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_searcher.py", line 167, in _find_patterns_apply_actions
GraphSearcher._find_patterns_apply_actions(self, consumer, pattern_matcher,
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_searcher.py", line 167, in _find_patterns_apply_actions
GraphSearcher._find_patterns_apply_actions(self, consumer, pattern_matcher,
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_searcher.py", line 167, in _find_patterns_apply_actions
GraphSearcher._find_patterns_apply_actions(self, consumer, pattern_matcher,
[Previous line repeated 980 more times]
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_searcher.py", line 145, in _find_patterns_apply_actions
matched_patterns_start_indices_dict = pattern_matcher.get_matching_patterns(op_types_sliding_window)
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_pattern_matcher.py", line 179, in get_matching_patterns
return self._get_all_sliced_patterns_and_match(sliding_window_op_type_pattern)
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_pattern_matcher.py", line 156, in _get_all_sliced_patterns_and_match
found_match, matched_pattern = self._get_matched_sliced_pattern(sliced_pattern)
File "/usr/local/lib/python3.10/dist-packages/aimet_common/graph_pattern_matcher.py", line 113, in _get_matched_sliced_pattern
if s_pattern == pattern_with_callback.pattern:
RecursionError: maximum recursion depth exceeded in comparison

@quic-geunlee
Copy link
Contributor

Hi @DongGeun123 Would you like to try the following code snippet before instantiating the QuantizationSimModel?

import sys
sys.setrecursionlimit(10**6)

@quic-hitameht quic-hitameht added the aimet-torch New feature or bug fix for AIMET PyTorch label Dec 10, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
aimet-torch New feature or bug fix for AIMET PyTorch
Projects
None yet
Development

No branches or pull requests

3 participants