Skip to content

Commit 175af0e

Browse files
committed
firt commit
0 parents  commit 175af0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5969
-0
lines changed

.github/workflows/black-ruff.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Black + Ruff Format Checker
2+
on: [push, pull_request]
3+
jobs:
4+
black-format-check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: psf/black@stable
9+
with:
10+
options: "--diff --check"
11+
src: "."
12+
ruff-format-check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: chartboost/ruff-action@v1

.github/workflows/check-urls.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Check URLs
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
schedule:
7+
# ┌───────────── minute (0 - 59)
8+
# │ ┌───────────── hour (0 - 23)
9+
# │ │ ┌───────────── day of the month (1 - 31)
10+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
11+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
12+
# │ │ │ │ │
13+
# │ │ │ │ │
14+
# │ │ │ │ │
15+
# * * * * *
16+
- cron: '30 1 * * 0'
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: urls-checker-code
26+
uses: urlstechie/urlchecker-action@master
27+
with:
28+
subfolder: experimental_experiment
29+
file_types: .md,.py,.rst,.ipynb
30+
print_all: false
31+
timeout: 2
32+
retry_count# : 2
33+
exclude_urls: https://github.com/pytorch/pytorch/pull/117009,https://github.com/huggingface/transformers/pull/29285,https://github.com/pytorch/pytorch/blob/a44f8894fa6d973693aab44a3dda079a168b05c1/torch/_decomp/decompositions.py#L1475
34+
exclude_patterns: https://dumps.wikimedia.org/,https://github.com/pytorch/pytorch/pull/,https://github.com/pytorch/pytorch/blob/a44f8894fa6d973693aab44a3dda079a168b05c1/torch/_decomp/decompositions.py#L1475,https://huggingface.co/
35+
# force_pass : true
36+
37+
- name: urls-checker-docs
38+
uses: urlstechie/urlchecker-action@master
39+
with:
40+
subfolder: _doc
41+
file_types: .md,.py,.rst,.ipynb
42+
print_all: false
43+
timeout: 2
44+
retry_count# : 2
45+
exclude_urls: https://hal.archives-,ouvertes.fr/hal-00990252/document,http://badge.fury.io/py/onnx-diagnostic,https://azure.microsoft.com/en-us/products/devops/pipelines,https://github.com/pytorch/pytorch/pull/83137#issuecomment-1211320670,https://github.com/NVIDIA/TransformerEngine.git@6a9edc38bf9b941b7d369af5103fa8fe0b121d61,https://medium.com/@msouza.os/llm-from-scratch-with-pytorch-9f21808c6319,https://github.com/pytorch/pytorch/blob/main/torch/fx/experimental/symbolic_shapes.py#L5965,https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html,https://badge.fury.io/py/onnx-diagnostic.svg,https://github.com/huggingface/transformers/pull/36311
46+
exclude_patterns: https://www.data.gouv.fr/fr/datasets/r/e3d83ab3-dc52-4c99-abaf-8a38050cc68c,https://dev.azure.com/,https://azure.microsoft.com/en-us/products/devops/pipelines,https://github.com/pytorch/pytorch/pull/83137#issuecomment-1211320670,https://github.com/NVIDIA/TransformerEngine.git@6a9edc38bf9b941b7d369af5103fa8fe0b121d61,https://github.com/pytorch/pytorch/blob/main/torch/,https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel-24-04.html,https://badge.fury.io/py/onnx-diagnostic.svg,https://github.com/huggingface/transformers/pull/36311
47+
# force_pass : true

.github/workflows/codeql.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: "Code Scanning - Action"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
schedule:
9+
# ┌───────────── minute (0 - 59)
10+
# │ ┌───────────── hour (0 - 23)
11+
# │ │ ┌───────────── day of the month (1 - 31)
12+
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
13+
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
14+
# │ │ │ │ │
15+
# │ │ │ │ │
16+
# │ │ │ │ │
17+
# * * * * *
18+
- cron: '30 1 * * 0'
19+
20+
jobs:
21+
CodeQL-Build:
22+
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
23+
runs-on: ubuntu-latest
24+
25+
permissions:
26+
# required for all workflows
27+
security-events: write
28+
29+
# only required for workflows in private repositories
30+
actions: read
31+
contents: read
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
# Initializes the CodeQL tools for scanning.
38+
- name: Initialize CodeQL
39+
uses: github/codeql-action/init@v2
40+
# Override language selection by uncommenting this and choosing your languages
41+
# with:
42+
# languages: go, javascript, csharp, python, cpp, java, ruby
43+
44+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
45+
# If this step fails, then you should remove it and run the build manually (see below).
46+
- name: Autobuild
47+
uses: github/codeql-action/autobuild@v2
48+
49+
# ℹ️ Command-line programs to run using the OS shell.
50+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
51+
52+
# ✏️ If the Autobuild fails above, remove it and uncomment the following
53+
# three lines and modify them (or add more) to build your code if your
54+
# project uses a compiled language
55+
56+
#- run: |
57+
# make bootstrap
58+
# make release
59+
60+
- name: Perform CodeQL Analysis
61+
uses: github/codeql-action/analyze@v2
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Documentation and Code Coverage
2+
3+
on:
4+
push:
5+
pull_request:
6+
types:
7+
- closed
8+
branches:
9+
- main
10+
11+
jobs:
12+
run:
13+
name: Build documentation on ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: [ubuntu-latest]
18+
19+
steps:
20+
- uses: actions/checkout@v3
21+
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: '3.12'
25+
26+
- uses: tlylt/install-graphviz@v1
27+
28+
- name: Install pandoc
29+
run: sudo apt-get install -y pandoc
30+
31+
- name: Install pytorch
32+
run: python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
33+
34+
# - name: Install numpy, onnxruntime-training
35+
# run: python -m pip install numpy onnxruntime-training
36+
37+
- name: Install requirements
38+
run: python -m pip install -r requirements.txt
39+
40+
- name: Install requirements dev
41+
run: |
42+
python -m pip install -r requirements-dev.txt
43+
44+
- name: Cache pip
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.cache/pip
48+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }}
49+
restore-keys: |
50+
${{ runner.os }}-pip-
51+
${{ runner.os }}-
52+
53+
- name: pip freeze
54+
run: python -m pip freeze
55+
56+
- name: Generate coverage report
57+
run: |
58+
pip install pytest
59+
pip install pytest-cov
60+
export PYTHONPATH=.
61+
UNITTEST_GOING=1 pytest --cov=./onnx_diagnostic/ --cov-report=xml --durations=10 _unittests
62+
export PYTHONPATH=
63+
64+
- name: Upload coverage reports to Codecov
65+
uses: codecov/codecov-action@v3
66+
env:
67+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
68+
69+
- name: Install
70+
run: python -m pip install -e . -v
71+
72+
- name: Copy license, changelogs
73+
run: |
74+
cp LICENSE* ./_doc
75+
cp CHANGELOGS* ./_doc
76+
77+
- name: Documentation
78+
continue-on-error: true
79+
run: UNITTEST_GOING=1 python -m sphinx ./_doc ./dist/html -n -w doc.txt
80+
81+
- name: Summary
82+
run: cat doc.txt
83+
84+
- name: Check for errors and warnings
85+
continue-on-error: true
86+
run: |
87+
if [[ $(grep ERROR doc.txt | grep -v 'Unknown target name: "l_shape"' | grep -v 'Unknown target name: "l_x"') ]]; then
88+
echo "Documentation produces errors."
89+
grep ERROR doc.txt
90+
exit 1
91+
fi
92+
if [[ $(grep WARNING doc.txt) ]]; then
93+
echo "Documentation produces warnings."
94+
grep WARNING doc.txt
95+
exit 1
96+
fi
97+
98+
- uses: actions/upload-artifact@v4
99+
with:
100+
path: ./dist/html/**
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
deploy:
20+
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- name: Set up Python
26+
uses: actions/setup-python@v3
27+
with:
28+
python-version: '3.x'
29+
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
pip install build
34+
35+
- name: Build package
36+
run: python -m build
37+
- name: Publish package
38+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
39+
with:
40+
user: sloaned
41+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/wheels-any.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build Any Wheel
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
9+
jobs:
10+
build_wheels:
11+
name: Build wheels on ${{ matrix.os }}
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- uses: actions/setup-python@v4
21+
with:
22+
python-version: '3.12'
23+
24+
- name: build wheel
25+
run: python -m pip wheel .
26+
27+
- uses: actions/upload-artifact@v4
28+
with:
29+
path: ./onnx_diagnostic*.whl

.gitignore

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
*.pyc
2+
*.pyd
3+
*.dylib
4+
*.so
5+
*.whl
6+
*.xlsx
7+
*.onnx
8+
*.onnx.data
9+
*.png
10+
*.csv
11+
*.pte
12+
*.ep
13+
*.ep.txt
14+
*.weight
15+
*.nsys-rep
16+
*.pkl
17+
*.xlsx
18+
*.sarif
19+
*.sqlitest
20+
*.svg
21+
*.onnx.stats
22+
CodeLlama*
23+
_tools/benchenv**
24+
_tools/repos**
25+
_tools/mamba**
26+
_tools/results**
27+
_tools/bin**
28+
nohup.out
29+
coverage.html/*
30+
temp*.txt*
31+
dump*.txt*
32+
dump*.onnx*
33+
temp_dump/*
34+
temp_data/*
35+
debug_data/*
36+
dump_models/*
37+
dump_bash_bench/*
38+
dump_llama/*
39+
dump_test*
40+
dump_sdpa_*
41+
temp_dump_models/*
42+
dump_dort_bench/*
43+
test_zoo_*/
44+
temp_llama_model_*/*
45+
test_*.txt
46+
_cache/*
47+
.coverage
48+
dist/*
49+
build/*
50+
.eggs/*
51+
.olive-cache/*
52+
.hypothesis/*
53+
*egg-info/*
54+
onnxruntime_profile*
55+
prof
56+
plot_*.txt
57+
_doc/auto_examples/*
58+
_doc/auto_recipes/*
59+
_doc/sg_execution_times.rst
60+
_doc/examples/_cache/*
61+
_doc/examples/dump_models/*
62+
_doc/examples/onnxruntime_profile*
63+
_doc/examples/plot_*.png
64+
_doc/examples/plot_*.xlsx
65+
_doc/examples/data/*.optimized.onnx
66+
_doc/examples/*.html
67+
_doc/_static/require.js
68+
_doc/_static/viz.js
69+
_doc/LICENSE.txt
70+
_doc/CHANGELOGS.rst
71+
_unittests/ut__main/*.png
72+
_unittests/ut__main/_cache/*
73+
_unittests/ut__main/*.html
74+
_unittests/.hypothesis/*

CHANGELOGS.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Change Logs
2+
===========
3+
4+
0.1.0
5+
+++++
6+
7+
first version

0 commit comments

Comments
 (0)