Unverified Commit ea9876e3 authored by msbaines's avatar msbaines Committed by GitHub
Browse files

[chore] update isort to 5.6.4 (#170)

parent 2108f20e
......@@ -148,7 +148,7 @@ jobs:
- run:
name: Run Linter (isort)
command: |
isort --check-only
isort . --check
- run:
name: Run Linter (black)
......@@ -245,6 +245,10 @@ jobs:
- run: nvidia-smi
- run: pyenv uninstall -f 3.7.0
- run: pyenv install 3.7.0
- run: pyenv global 3.7.0
- <<: *setup_venv
......@@ -252,14 +256,14 @@ jobs:
# Cache the venv directory that contains dependencies
- restore_cache:
keys:
- cache-key-gpu16-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
- cache-key-benchmarks-{{ checksum "setup.py"}}-{{ checksum "requirements-test.txt"}}
- <<: *install_dep_16
- save_cache:
paths:
- ~/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
......
......@@ -33,8 +33,8 @@ repos:
- id: seed-isort-config
language_version: python3.6
- repo: https://github.com/timothycrosley/isort
rev: 4.3.20
- repo: https://github.com/pycqa/isort
rev: 5.6.4
hooks:
- id: isort
exclude: README.md
......
......@@ -188,8 +188,8 @@ def make_model(args, device, ntokens):
def get_tensors_by_size_bucket():
import gc
from collections import defaultdict
import gc
size_buckets = defaultdict(int)
for obj in gc.get_objects():
......@@ -202,8 +202,8 @@ def get_tensors_by_size_bucket():
def dump_size_buckets(size_buckets, prefix=""):
import operator
from functools import reduce
import operator
total = 0
for key, value in size_buckets.items():
......@@ -247,8 +247,8 @@ def check_size_buckets():
def dump_cuda_tensors():
print(f"dumping cuda tensors...")
from functools import reduce
import operator
import gc
import operator
for obj in gc.get_objects():
if not isinstance(obj, torch.Tensor):
......
......@@ -20,4 +20,12 @@ exclude = '''
'''
[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"]
black == 19.10b0
flake8 == 3.7.9
isort == 4.3.21
isort == 5.6.4
mpi4py == 3.0.3
mypy == 0.770
pytest == 5.4.1
......
......@@ -34,21 +34,6 @@ ignore =
per-file-ignores = __init__.py: F401
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
# -----------------------------------------------------------------------------
......
......@@ -10,7 +10,7 @@ import pytest
import torch
try:
from fairscale.optim import Adam, Precision, GradScaler
from fairscale.optim import Adam, GradScaler, Precision
imported_adam = True
except ImportError:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment