Skip to content

Commit ad6f8c9

Browse files
committed
Refactor repository's structure and add build CI
1 parent f87f55f commit ad6f8c9

38 files changed

+57
-78
lines changed

.github/workflows/CI.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
10+
build-deepquant:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repo
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
- name: Build DeepQuant
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -e .

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ dist/
2828
*.onnx
2929
*.npz
3030
onnx/*
31+
Dataset/*
File renamed without changes.
File renamed without changes.
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,12 @@ def exportBrevitas(
6868
nn.Module: An FX GraphModule with explicit quantization operations.
6969
"""
7070

71-
# EXPORT_FOLDER = (
72-
# Path().cwd()
73-
# ) # Initialize export folder to current working directory
74-
# print(EXPORT_FOLDER) # Display export folder path for reference
75-
# if Path().cwd().name != "onnx": # Check if already in 'onnx' directory
76-
# EXPORT_FOLDER = (
77-
# EXPORT_FOLDER / "onnx"
78-
# ) # If not, create/use an 'onnx' subdirectory
79-
8071
EXPORT_FOLDER = Path().cwd()
81-
print(EXPORT_FOLDER)
82-
if Path().cwd().name != "onnx":
83-
EXPORT_FOLDER = EXPORT_FOLDER / "onnx"
72+
if Path().cwd().name == "DeepQuant":
73+
EXPORT_FOLDER = EXPORT_FOLDER / "Tests/ONNX"
8474
EXPORT_FOLDER.mkdir(parents=True, exist_ok=True)
8575

86-
printer = GraphModulePrinter() # Instantiation of the custom printer
76+
printer = GraphModulePrinter()
8777

8878
###############################################################################
8979
# 1. Original Network
@@ -105,12 +95,6 @@ def exportBrevitas(
10595
example_input
10696
) # Compute original model output on example input for validation
10797

108-
# torch.onnx.export(
109-
# model, # Model to export
110-
# args=example_input, # Example input for tracing
111-
# f=EXPORT_FOLDER / "1_model_qcdq_original.onnx",
112-
# opset_version=13,
113-
# )
11498
export_onnx_qcdq( # Export original model to ONNX format with QCDQ (Quant-Cast-DeQuant) nodes
11599
model, # Model to export
116100
args=example_input, # Example input for tracing

0 commit comments

Comments
 (0)