Skip to content

Commit 98129f1

Browse files
committed
v0.2.2.post1 for Windows
0 parents  commit 98129f1

File tree

304 files changed

+61021
-0
lines changed

Some content is hidden

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

304 files changed

+61021
-0
lines changed

.clang-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
BasedOnStyle: Google
3+
DerivePointerAlignment: false
4+
ColumnLimit: 100
5+
PointerAlignment: Left
6+
# InsertNewlineAtEOF: true
7+
...

.devcontainer/Dockerfile

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
FROM nvidia/cuda:12.4.0-devel-ubuntu22.04
2+
3+
# Update package lists and install system dependencies
4+
RUN apt-get update && apt-get install -y \
5+
curl \
6+
git \
7+
clang-format \
8+
libibverbs-dev \
9+
librdmacm-dev \
10+
rdma-core \
11+
libnuma-dev \
12+
vim \
13+
openmpi-bin \
14+
libopenmpi-dev \
15+
zsh \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
# Install oh-my-zsh
19+
RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
20+
21+
# Install powerlevel10k theme
22+
RUN git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
23+
24+
# Install zsh-autosuggestions
25+
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
26+
27+
# Configure zsh
28+
RUN sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc && \
29+
sed -i 's/plugins=(git)/plugins=(git zsh-autosuggestions)/' ~/.zshrc
30+
31+
# Create a non-root user
32+
ARG USERNAME=devuser
33+
ARG USER_UID=1003
34+
ARG USER_GID=$USER_UID
35+
36+
# Create the user
37+
RUN groupadd --gid $USER_GID $USERNAME \
38+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
39+
# [Optional] Add sudo support
40+
&& apt-get update \
41+
&& apt-get install -y sudo \
42+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
43+
&& chmod 0440 /etc/sudoers.d/$USERNAME \
44+
&& rm -rf /var/lib/apt/lists/*
45+
46+
# Copy zsh configuration to the new user's home
47+
RUN cp -r /root/.oh-my-zsh /home/$USERNAME/.oh-my-zsh && \
48+
cp /root/.zshrc /home/$USERNAME/.zshrc && \
49+
chown -R $USERNAME:$USERNAME /home/$USERNAME/.oh-my-zsh && \
50+
chown $USERNAME:$USERNAME /home/$USERNAME/.zshrc
51+
52+
# Switch to non-root user
53+
USER $USERNAME
54+
WORKDIR /home/$USERNAME
55+
56+
# Set zsh as default shell
57+
ENV SHELL=/bin/zsh
58+
CMD [ "zsh" ]

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "CUDA Development Container",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "."
6+
},
7+
"runArgs": [
8+
"--gpus=all"
9+
],
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
]
14+
}
15+
},
16+
"remoteUser": "devuser"
17+
}

.github/workflows/build-doc.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build FlashInfer Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
test_linux:
22+
name: Deploy Docs
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v2
27+
with:
28+
submodules: recursive
29+
30+
- name: Configuring build Environment
31+
run: |
32+
sudo apt-get update
33+
python -m pip install -U pip wheel
34+
35+
- name: Installing dependencies
36+
run: |
37+
python -m pip install -r docs/requirements.txt
38+
39+
- name: Bulid Documentation
40+
if: github.ref == 'refs/heads/main'
41+
run: |
42+
cd docs
43+
make html
44+
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v3
47+
with:
48+
# Upload entire repository
49+
path: 'docs/_build/html'
50+
51+
- name: Deploy to GitHub Pages
52+
id: deployment
53+
uses: actions/deploy-pages@v4
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Adapted from https://github.com/punica-ai/punica/blob/591b59899f0a20760821785d06b331c8a2e5cb86/.github/workflows/release_wheel.yml
2+
name: Release
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag_name:
7+
required: true
8+
type: string
9+
workflow_call:
10+
inputs:
11+
tag_name:
12+
required: true
13+
type: string
14+
secrets:
15+
WHL_TOKEN:
16+
required: true
17+
# PYPI_TEST_TOKEN:
18+
# required: true
19+
20+
env:
21+
TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX"
22+
23+
jobs:
24+
build:
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
cuda: ["11.8", "12.1", "12.4"]
29+
torch: ["2.4", "2.5", "2.6"]
30+
exclude: # We use release_wheel_sglang.yml for faster release and verification. If everything is okay, then we trigger release_wheel.yml. This combination (cuda 12.4 or 11.8 + torch 2.5) is already handled in release_wheel_sglang.yml
31+
- cuda: "12.4"
32+
torch: "2.5"
33+
- cuda: "11.8"
34+
torch: "2.5"
35+
- cuda: "12.1"
36+
torch: "2.6"
37+
38+
runs-on: [self-hosted]
39+
steps:
40+
- uses: actions/checkout@v4
41+
with:
42+
submodules: true
43+
44+
- name: Build wheel
45+
run: |
46+
chown -R $CI_UID:$CI_GID "$GITHUB_WORKSPACE"
47+
docker run --rm -t \
48+
-v "$CI_RUNNER_CACHE_DIR":/ci-cache \
49+
-v "$GITHUB_WORKSPACE":/app \
50+
-e FLASHINFER_CI_CACHE=/ci-cache \
51+
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \
52+
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \
53+
-e FLASHINFER_CI_PYTHON_VERSION=3.10 \
54+
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
55+
-e MAX_JOBS=128 \
56+
--user $CI_UID:$CI_GID \
57+
pytorch/manylinux-builder:cuda${{ matrix.cuda }} \
58+
bash /app/scripts/run-ci-build-wheel.sh
59+
timeout-minutes: 120
60+
- run: du -h dist/*
61+
62+
- uses: actions/upload-artifact@v4
63+
with:
64+
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}
65+
path: dist/*
66+
67+
release:
68+
needs: build
69+
runs-on: [self-hosted]
70+
steps:
71+
- uses: actions/download-artifact@v4
72+
with:
73+
path: dist/
74+
merge-multiple: true
75+
pattern: wheel-*
76+
77+
- run: ls -lah dist/
78+
79+
- uses: softprops/action-gh-release@v1
80+
with:
81+
tag_name: ${{ inputs.tag_name }}
82+
files: |
83+
dist/flashinfer*.whl
84+
85+
- uses: softprops/action-gh-release@v1
86+
with:
87+
tag_name: ${{ inputs.tag_name }}
88+
files: |
89+
dist/flashinfer-*.tar.gz
90+
91+
- name: Clone wheel index
92+
run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl
93+
env:
94+
WHL_TOKEN: ${{ secrets.WHL_TOKEN }}
95+
96+
- name: Update wheel index
97+
run: python3 scripts/update_whl_index.py
98+
99+
- name: Push wheel index
100+
run: |
101+
cd flashinfer-whl
102+
git config --local user.name "github-actions[bot]"
103+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
104+
git add -A
105+
git commit -m "update whl"
106+
git push
107+
108+
# - name: Upload sdist to pypi
109+
# run: |
110+
# pip install twine
111+
# python -m twine upload --repository testpypi --username=__token__ dist/*.tar.gz
112+
# env:
113+
# TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Release Wheel
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
tag_name:
6+
required: true
7+
type: string
8+
workflow_call:
9+
inputs:
10+
tag_name:
11+
required: true
12+
type: string
13+
secrets:
14+
WHL_TOKEN:
15+
required: true
16+
17+
env:
18+
TORCH_CUDA_ARCH_LIST: "7.5 8.0 8.9 9.0+PTX"
19+
20+
jobs:
21+
build:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
cuda: ["11.8", "12.4"]
26+
torch: ["2.5"]
27+
28+
runs-on: [self-hosted]
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
submodules: true
33+
34+
- name: Build wheel
35+
run: |
36+
chown -R $CI_UID:$CI_GID "$GITHUB_WORKSPACE"
37+
docker run --rm -t \
38+
-v "$CI_RUNNER_CACHE_DIR":/ci-cache \
39+
-v "$GITHUB_WORKSPACE":/app \
40+
-e FLASHINFER_CI_CACHE=/ci-cache \
41+
-e FLASHINFER_CI_CUDA_VERSION=${{ matrix.cuda }} \
42+
-e FLASHINFER_CI_TORCH_VERSION=${{ matrix.torch }} \
43+
-e FLASHINFER_CI_PYTHON_VERSION=3.10 \
44+
-e FLASHINFER_HEAD_DIMS="64,128,256" \
45+
-e TORCH_CUDA_ARCH_LIST="$TORCH_CUDA_ARCH_LIST" \
46+
-e MAX_JOBS=128 \
47+
--user $CI_UID:$CI_GID \
48+
pytorch/manylinux-builder:cuda${{ matrix.cuda }} \
49+
bash /app/scripts/run-ci-build-wheel.sh
50+
timeout-minutes: 120
51+
- run: du -h dist/*
52+
53+
- uses: actions/upload-artifact@v4
54+
with:
55+
name: wheel-cuda${{ matrix.cuda }}-torch${{ matrix.torch }}
56+
path: dist/*
57+
58+
release:
59+
needs: build
60+
runs-on: [self-hosted]
61+
steps:
62+
- uses: actions/download-artifact@v4
63+
with:
64+
path: dist/
65+
merge-multiple: true
66+
pattern: wheel-*
67+
68+
- run: ls -lah dist/
69+
70+
- uses: softprops/action-gh-release@v1
71+
with:
72+
tag_name: ${{ inputs.tag_name }}
73+
files: |
74+
dist/flashinfer*.whl
75+
76+
- uses: softprops/action-gh-release@v1
77+
with:
78+
tag_name: ${{ inputs.tag_name }}
79+
files: |
80+
dist/flashinfer-*.tar.gz
81+
82+
- name: Clone wheel index
83+
run: git clone https://oauth2:${WHL_TOKEN}@github.com/flashinfer-ai/whl.git flashinfer-whl
84+
env:
85+
WHL_TOKEN: ${{ secrets.WHL_TOKEN }}
86+
87+
- name: Update wheel index
88+
run: python3 scripts/update_whl_index.py
89+
90+
- name: Push wheel index
91+
run: |
92+
cd flashinfer-whl
93+
git config --local user.name "github-actions[bot]"
94+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
95+
git add -A
96+
git commit -m "update whl"
97+
git push

0 commit comments

Comments
 (0)