-
Notifications
You must be signed in to change notification settings - Fork 249
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
Enable FunctionHookMode tracing by default #3338
base: develop
Are you sure you want to change the base?
Enable FunctionHookMode tracing by default #3338
Conversation
74f1c7b
to
e30e802
Compare
e30e802
to
9266901
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check your PR with #3322 and run the nightly training test for Torch backend.
cc' @ljaljushkin
device = None | ||
if not is_multidevice(wrapped_model): | ||
device = get_model_device(wrapped_model) | ||
else: | ||
nncf_logger.warning("Model is on multiple devices. Cannot determine device for loaded modules.") | ||
|
||
hook_storage = get_hook_storage(wrapped_model) | ||
transformation_commands = cast(List[S_COMMAND], config[COMPRESSION_STATE_ATTR]) | ||
for command in transformation_commands: | ||
module_cls = COMPRESSION_MODULES.get(command["module_cls_name"]) | ||
module = module_cls.from_config(command["module_config"]) | ||
module.to(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I encountered the same problem with the model on various devices:
https://github.com/openvinotoolkit/nncf/pull/3341/files#diff-f257219eb5631518ca7ec37bb9858c77491049dc999ca14d845a46517f263900R135-R136
Is there a reliable method to match the compression module from the insertion command to the target layer and its parameters? With this matching, it would be possible to determine the device.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently we have limited support for multidevice models.
For not multi device model it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multidevice case is very popular for LLMs. @AlexanderDokuchaev, do you have any idea how torch2 will support it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not look at it. Currently multidevice support for new tracing works similar like for current.
@@ -96,7 +96,7 @@ resuming_checkpoint = torch.load(path) | |||
nncf_config = resuming_checkpoint['nncf_config'] | |||
state_dict = resuming_checkpoint['state_dict'] | |||
|
|||
quantized_model = nncf.torch.load_from_config(model, nncf_config, dummy_input) | |||
quantized_model = nncf.torch.load_from_config(model, nncf_config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the main Readme:
- using nncf.torch.get_config() / nncf.torch.load_from_config() in Training-Time Quantization
- add note that create_compressed API is deprecated in Training-Time Compression.
OpenVINO documentation should be also update regarding the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using nncf.torch.get_config() / nncf.torch.load_from_config() in Training-Time Quantization
done
add note that create_compressed API is deprecated in Training-Time Compression.
we have already have deprecation message in create_compressed sine previous release, what a reason to duplicate it in readme now?
device = None | ||
if not is_multidevice(wrapped_model): | ||
device = get_model_device(wrapped_model) | ||
else: | ||
nncf_logger.warning("Model is on multiple devices. Cannot determine device for loaded modules.") | ||
|
||
hook_storage = get_hook_storage(wrapped_model) | ||
transformation_commands = cast(List[S_COMMAND], config[COMPRESSION_STATE_ATTR]) | ||
for command in transformation_commands: | ||
module_cls = COMPRESSION_MODULES.get(command["module_cls_name"]) | ||
module = module_cls.from_config(command["module_config"]) | ||
module.to(device) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multidevice case is very popular for LLMs. @AlexanderDokuchaev, do you have any idea how torch2 will support it?
Changes
Related tickets
152996
Tests
https://github.com/openvinotoolkit/nncf/actions/runs/13846083796
https://github.com/openvinotoolkit/nncf/actions/runs/13846090769
manual/job/post_training_quantization/630/