-
Notifications
You must be signed in to change notification settings - Fork 228
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
[Bug] (suggested temporary fix) Pytorch >= 2 causes mmrazor.engine to fail #632
Comments
Also related to #553 |
If you look at the source code, this error does not require torch to be higher than 1.13, but less than or equal to 1.13, and degrading torch will fix the problem. |
Then the requirements files need to be updated and follow PEP.
Regardless, torch 1.13 is extremely outdated, please update the source code. |
Note, the suggested fix above will not work with fusions because of the changes in the BackendPatternConfig from torch 1 to torch 2. Any model with potential fusions will have mishaps in torch 2 unless updating these BackendPatternConfig to match the new version. |
Describe the bug
When using
tools/train.py
, I get the following error:However I am using torch 2.0.0:
To Reproduce
The command you executed.
configuration redacted.
Additional context
Checking the
mmrazor/structures/quantization/backend_config/common_operator_config_utils.py
myself led me to find this line:Executing that line in my local environment resulted in a module name error, so I checked further.
Looking at the pytorch repository under 2.0.0,
torch.ao.quantization.fuser_method_mappings.reverse2
is nowtorch.ao.quantization.fuser_method_mappings._reverse2
, and the same thing happens withreverse3 -> _reverse3
. Furthermore, thereverse_sequential_wrapper2
is gone altogether.Other namespaces that disappeared were:
torch.ao.quantization.backend_config.BackendPatternConfig._set_overwrite_output_fake_quantize
torch.ao.quantization.backend_config.BackendPatternConfig._set_overwrite_output_observer
torch.ao.quantization.backend_config.BackendPatternConfig._set_input_output_observed
Monkey patching all these with the removed methods and the changed namespaces and then calling
import mmrazor.engine
produces no errors anymore, but the solution needs to be >= torch2.0.0 compatible moving forward.This bug might be related to #615
The text was updated successfully, but these errors were encountered: