Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Sep 30, 2024
1 parent 2efda7d commit 7c4b01f
Show file tree
Hide file tree
Showing 17 changed files with 1,452 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ jobs:
with:
python-version: 3.10.14
- name: Install NNCF
run: pip install -e .
run: |
pip install -e .
pip install torch -c constraints.txt
- name: Install mypy
run: pip install mypy==1.8.0
- name: Run mypy
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,22 @@ jobs:
run: pip list
- name: Run tools precommit test scope
run: PYTHONPATH=./ pytest -ra tests/tools

pytorch2-cpu:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
lfs: true
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: 3.10.14
cache: pip
- name: Install NNCF and test requirements
run: |
pip install -e .
pip install -r tests/torch2/requirements.txt
- name: Print installed modules
run: pip list
- name: Run tools precommit test scope
run: pytest -ra tests/torch2
2 changes: 1 addition & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
files = nncf/common/sparsity, nncf/common/graph, nncf/common/accuracy_aware_training/, nncf/common/utils/, nncf/common/tensor_statistics
files = nncf/torch2, nncf/common/sparsity, nncf/common/graph, nncf/common/accuracy_aware_training/, nncf/common/utils/, nncf/common/tensor_statistics
follow_imports = silent
strict = True

Expand Down
10 changes: 10 additions & 0 deletions nncf/torch2/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (c) 2024 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.
16 changes: 16 additions & 0 deletions nncf/torch2/hook_executor/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2024 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.

from nncf.torch2.hook_executor.wrapper import get_hook_storage as get_hook_storage
from nncf.torch2.hook_executor.wrapper import insert_hook as insert_hook
from nncf.torch2.hook_executor.wrapper import is_wrapped as is_wrapped
from nncf.torch2.hook_executor.wrapper import remove_group as remove_group
from nncf.torch2.hook_executor.wrapper import wrap_model as wrap_model
Loading

0 comments on commit 7c4b01f

Please sign in to comment.