Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
briancpark committed Jan 18, 2024
1 parent 85a85ca commit edf965f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,26 @@ on:
- cron: '0 0 1 * *'

jobs:
pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.10
- name: Install CSC 791
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements.txt
- name: Run pylint
run: |
pylint proj1/proj1.py
pylint proj2/proj2.py
pylint proj3/proj3.py
pylint proj3/model.py
pylint proj4/proj4.py
# pylint final/final.py
lint:
runs-on: ubuntu-latest
steps:
Expand Down
5 changes: 3 additions & 2 deletions final/final.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

# pylint: disable=redefined-outer-name,invalid-name,import-outside-toplevel,too-many-lines
# pylint: disable=too-many-arguments,too-many-locals,not-callable,too-many-branches
# pylint: disable=too-many-statements,pointless-exception-statement,protected-access
# pylint: disable=too-many-statements,pointless-exception-statement,protected-access,fixme

from model import (
FMEN,
Expand Down Expand Up @@ -800,7 +800,8 @@ def prune(

if logging:
with open(
f"logs/{pruner.__class__.__name__}_{upscale_factor}_{model.__class__.__name__ }.csv",
f"logs/{pruner.__class__.__name__}_{upscale_factor}\
_{model.__class__.__name__ }.csv",
"a",
encoding="utf-8",
) as fh:
Expand Down
2 changes: 1 addition & 1 deletion proj1/job-gpu
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#SBATCH -N 1
#SBATCH -n 1
#SBATCH -p rome
#SBATCH -p a6000
#SBATCH -t 24:00:00

nvidia-smi
Expand Down
5 changes: 3 additions & 2 deletions proj1/proj1.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
# defaults to True.
torch.backends.cudnn.allow_tf32 = True

torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = True
torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = False


class Net(nn.Module):
Expand Down Expand Up @@ -199,7 +199,7 @@ def load_data(train_kwargs, test_kwargs, mnist=True):


def train_models(resnet=False, retrain=False):
""" "Train the models"""
"""Train the models"""
train_kwargs = {"batch_size": batch_size}
test_kwargs = {"batch_size": test_batch_size}

Expand Down Expand Up @@ -606,6 +606,7 @@ def benchmark(device, pruner_name, resnet=False):

if args.train:
train_models(resnet=True, retrain=False)
train_models(resnet=False, retrain=False)

elif args.prune:
if device.type == "mps":
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ nvidia-tensorrt
tensorboard<=2.80
torchviz>=0.0.2
black
pylint
numpy
pandas
matplotlib
Expand Down

0 comments on commit edf965f

Please sign in to comment.