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

Update for nncf_task #145

Merged
merged 8 commits into from
Mar 22, 2022
Merged

Update for nncf_task #145

merged 8 commits into from
Mar 22, 2022

Conversation

AlexanderDokuchaev
Copy link
Contributor

@AlexanderDokuchaev AlexanderDokuchaev commented Mar 14, 2022

Rework nncf integration to use in OTE:

  • update callback
  • remove nncf from configs (will support via ote)
  • rename compression to openvino in config and CompressModelCallback to OpenVINOCalback because model_optimizer does not compress model and it can confuse users.

Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AlexanderDokuchaev, Thank you for making this PR. I have few comments and opens that I left in the code.

anomalib/integration/nncf/compression.py Outdated Show resolved Hide resolved
Comment on lines 1 to 15
"""Integration."""

# Copyright (C) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions
# and limitations under the License.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than creating anomalib/integration, we could place nncf_callback and utils.py into anomalib/utils/callbacks/nncf. In this case, the existing flow would be kept as is. More specifically, the structure of anomailb/utils/callbackwould be something like the following:

.
├── __init__.py
├── callbacks
│   ├── __init__.py
│   ├── cdf_normalization.py
│   ├── compress.py
│   ├── min_max_normalization.py
│   ├── model_loader.py
│   ├── nncf
│   │   ├── __init__.py
│   │   ├── nncf_callback.py
│   │   └── utils.py
│   ├── save_to_csv.py
│   ├── tiler.py
│   ├── timer.py
│   └── visualizer_callback.py

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Let's stick to the existing structure and place the nncf files under callbacks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AlexanderDokuchaev! Really appreciate the effort!

@samet-akcay samet-akcay merged commit 834d45a into development Mar 22, 2022
@samet-akcay samet-akcay deleted the ad/nncf_task branch March 22, 2022 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants