8000 Update lint github workflow by jansel · Pull Request #31 · pytorch-labs/helion · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update lint github workflow #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Lint

on:
push:
branches:
- main
# Include any branch created via ghstack
- gh/**
pull_request:
branches:
- main
- gh/*

jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: torch27
python-version: 3.12
channels: defaults,pytorch,conda-forge

- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.conda/pkgs
~/.cache/pip
~/miniconda/envs/torch27
key: ${{ runner.os }}-deps-${{ hashFiles('.github/workflows/lint.yml') }}
restore-keys: |
${{ runner.os }}-deps-

- name: Install CUDA
run: |
conda install nvidia/label/cuda-12.8.1::cuda-toolkit

- name: Install PyTorch
run: |
pip3 install torch --index-url https://download.pytorch.org/whl/cu128

- name: Install lint dependencies
run: ./lint.sh install

- name: Run lint checks
run: ./lint.sh check
22 changes: 0 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,6 @@ concurrency:
cancel-in-progress: true

jobs:
lint:
strategy:
fail-fast: true
matrix:
include:
- name: c5.4xlarge
runs-on: linux.4xlarge
# install the CUDA version to also get triton (needed by pyre type-checking)
torch-spec: '--pre torch --index-url https://download.pytorch.org/whl/nightly/cu126'
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
with:
timeout: 60
runner: ${{ matrix.runs-on }}
submodules: recursive
script: |
conda create -n venv python=3.10 -y
conda activate venv
python -m pip install --upgrade pip
pip install ${{ matrix.torch-spec }}
./.github/scripts/install_triton.sh
./lint.sh install
./lint.sh check
test_cuda126_py310_a10g:
name: test-cuda12.6-py3.10-a10g
strategy:
Expand Down
36 changes: 2 additions & 34 deletions lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,8 @@ fi
if [ "$ACTION" = "install" ];
then
set -ex
# NOTE: Unfortunately the pyre-check binary from pip expects GLIBC_2.29 but our CI machine's linux image only has GLIBC_2.28.
# So we have to build the pyre-check binary from source. (See https://github.com/facebook/pyre-check/issues/985)
# Q: If we are building from source anyway, why do we still need to do `pip install pyre-check==0.9.23`?
# A: I tried that and the from-source Python client actually generates many more type errors (likely related to `typeshed` config).
# So in the interest of time, I decided to just use the pip-installed version for the Python client, but use the from-source version for the server binary.
pip install ruff==0.9.8 pyre-check==0.9.23
(
mkdir -p /tmp/$USER
pushd /tmp/$USER
rm -rf pyre-check-for-helion/ || true
git clone https://github.com/facebook/pyre-check.git -b v0.9.23 pyre-check-for-helion/
(
pushd pyre-check-for-helion/

# Install toolchain
conda config --set channel_priority strict
conda install -y -c conda-forge conda=25.3.1 conda-libmamba-solver
conda config --set solver libmamba
conda install -y -c conda-forge "rust>=1.77"
conda install -y -c conda-forge bubblewrap opam

# Build pyre-check
./scripts/setup.sh --local --no-tests
install -m755 ./source/_build/default/main.exe "$CONDA_PREFIX/bin/pyre.bin"
rm -rf ./source/_build/

ldd --version # shows the host's GLIBC version
conda run pyre.bin --version # check there is no GLIBC version mismatch

popd
)
rm -rf pyre-check-for-helion/
popd
)
# pyre requires click<8.2
pip install ruff==0.11.9 pyre-check==0.9.23 click==8.1.0
exit 0
fi

Expand Down
Loading
0