Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
fairscale
Commits
ea9876e3
Unverified
Commit
ea9876e3
authored
Oct 27, 2020
by
msbaines
Committed by
GitHub
Oct 27, 2020
Browse files
[chore] update isort to 5.6.4 (#170)
parent
2108f20e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
26 deletions
+23
-26
.circleci/config.yml
.circleci/config.yml
+7
-3
.pre-commit-config.yaml
.pre-commit-config.yaml
+2
-2
benchmarks/pipe.py
benchmarks/pipe.py
+3
-3
pyproject.toml
pyproject.toml
+9
-1
requirements-test.txt
requirements-test.txt
+1
-1
setup.cfg
setup.cfg
+0
-15
tests/optim/test_adam.py
tests/optim/test_adam.py
+1
-1
No files found.
.circleci/config.yml
View file @
ea9876e3
...
@@ -148,7 +148,7 @@ jobs:
...
@@ -148,7 +148,7 @@ jobs:
-
run
:
-
run
:
name
:
Run Linter (isort)
name
:
Run Linter (isort)
command
:
|
command
:
|
isort --check
-only
isort
.
--check
-
run
:
-
run
:
name
:
Run Linter (black)
name
:
Run Linter (black)
...
@@ -245,6 +245,10 @@ jobs:
...
@@ -245,6 +245,10 @@ jobs:
-
run
:
nvidia-smi
-
run
:
nvidia-smi
-
run
:
pyenv uninstall -f 3.7.0
-
run
:
pyenv install 3.7.0
-
run
:
pyenv global 3.7.0
-
run
:
pyenv global 3.7.0
-
<<
:
*setup_venv
-
<<
:
*setup_venv
...
@@ -252,14 +256,14 @@ jobs:
...
@@ -252,14 +256,14 @@ jobs:
# Cache the venv directory that contains dependencies
# Cache the venv directory that contains dependencies
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
cache-key-
gpu16
-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
-
cache-key-
benchmarks
-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
-
<<
:
*install_dep_16
-
<<
:
*install_dep_16
-
save_cache
:
-
save_cache
:
paths
:
paths
:
-
~/venv
-
~/venv
key
:
cache-key-
gpu16
-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
key
:
cache-key-
benchmarks
-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
-
<<
:
*install_repo_gpu
-
<<
:
*install_repo_gpu
...
...
.pre-commit-config.yaml
View file @
ea9876e3
...
@@ -33,8 +33,8 @@ repos:
...
@@ -33,8 +33,8 @@ repos:
-
id
:
seed-isort-config
-
id
:
seed-isort-config
language_version
:
python3.6
language_version
:
python3.6
-
repo
:
https://github.com/
timothycrosley
/isort
-
repo
:
https://github.com/
pycqa
/isort
rev
:
4.3.20
rev
:
5.6.4
hooks
:
hooks
:
-
id
:
isort
-
id
:
isort
exclude
:
README.md
exclude
:
README.md
...
...
benchmarks/pipe.py
View file @
ea9876e3
...
@@ -188,8 +188,8 @@ def make_model(args, device, ntokens):
...
@@ -188,8 +188,8 @@ def make_model(args, device, ntokens):
def
get_tensors_by_size_bucket
():
def
get_tensors_by_size_bucket
():
import
gc
from
collections
import
defaultdict
from
collections
import
defaultdict
import
gc
size_buckets
=
defaultdict
(
int
)
size_buckets
=
defaultdict
(
int
)
for
obj
in
gc
.
get_objects
():
for
obj
in
gc
.
get_objects
():
...
@@ -202,8 +202,8 @@ def get_tensors_by_size_bucket():
...
@@ -202,8 +202,8 @@ def get_tensors_by_size_bucket():
def
dump_size_buckets
(
size_buckets
,
prefix
=
""
):
def
dump_size_buckets
(
size_buckets
,
prefix
=
""
):
import
operator
from
functools
import
reduce
from
functools
import
reduce
import
operator
total
=
0
total
=
0
for
key
,
value
in
size_buckets
.
items
():
for
key
,
value
in
size_buckets
.
items
():
...
@@ -247,8 +247,8 @@ def check_size_buckets():
...
@@ -247,8 +247,8 @@ def check_size_buckets():
def
dump_cuda_tensors
():
def
dump_cuda_tensors
():
print
(
f
"dumping cuda tensors..."
)
print
(
f
"dumping cuda tensors..."
)
from
functools
import
reduce
from
functools
import
reduce
import
operator
import
gc
import
gc
import
operator
for
obj
in
gc
.
get_objects
():
for
obj
in
gc
.
get_objects
():
if
not
isinstance
(
obj
,
torch
.
Tensor
):
if
not
isinstance
(
obj
,
torch
.
Tensor
):
...
...
pyproject.toml
View file @
ea9876e3
...
@@ -20,4 +20,12 @@ exclude = '''
...
@@ -20,4 +20,12 @@ exclude = '''
'''
'''
[tool.isort]
[tool.isort]
known_third_party
=
"benchmark_dataset,dataclasses,numpy,packaging,pytest,recommonmark,setuptools,torch,torchtext,torchvision"
line_length
=
120
multi_line_output
=
3
include_trailing_comma
=
true
force_grid_wrap
=
0
use_parentheses
=
true
skip_glob
=
[
"build/*"
,
"stubs/*"
]
# Don't split "import" and "from".
force_sort_within_sections
=
true
known_third_party
=
[
"benchmark_dataset"
,
"dataclasses"
,
"numpy"
,
"packaging"
,
"pytest"
,
"recommonmark"
,
"setuptools"
,
"torch"
,
"torchtext"
,
"torchvision"
]
requirements-test.txt
View file @
ea9876e3
black == 19.10b0
black == 19.10b0
flake8 == 3.7.9
flake8 == 3.7.9
isort ==
4.3.21
isort ==
5.6.4
mpi4py == 3.0.3
mpi4py == 3.0.3
mypy == 0.770
mypy == 0.770
pytest == 5.4.1
pytest == 5.4.1
...
...
setup.cfg
View file @
ea9876e3
...
@@ -34,21 +34,6 @@ ignore =
...
@@ -34,21 +34,6 @@ ignore =
per-file-ignores = __init__.py: F401
per-file-ignores = __init__.py: F401
exclude = build,*.pyi,.git
exclude = build,*.pyi,.git
# -----------------------------------------------------------------------------
# isort
# -----------------------------------------------------------------------------
[isort]
line_length = 120
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
skip_glob = build/*,stubs/*
# Don't split "import" and "from".
force_sort_within_sections = true
known_third_party = pytest,setuptools,torch,torchtext
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# mypy
# mypy
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
...
...
tests/optim/test_adam.py
View file @
ea9876e3
...
@@ -10,7 +10,7 @@ import pytest
...
@@ -10,7 +10,7 @@ import pytest
import
torch
import
torch
try
:
try
:
from
fairscale.optim
import
Adam
,
Precision
,
GradScaler
from
fairscale.optim
import
Adam
,
GradScaler
,
Precision
imported_adam
=
True
imported_adam
=
True
except
ImportError
:
except
ImportError
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment