Darkweb007/cuda-kernels
cuda-kernels
One Space, three tabs:
- Push to Hub — push any local folder to a Hugging Face Hub repo (model/dataset/space) without the CLI.
- Sliding-window attention — a from-scratch CUDA kernel, JIT-compiled and run live on this Space's GPU, benchmarked against dense PyTorch attention.
- Kernel fusion compiler — auto-fuses
y = gelu(x*w + b)into one CUDA kernel, compiles it, and runs it live against the naive 3-kernel-launch version.
Tabs 2 and 3 need an actual GPU attached to this Space. If you see "No CUDA GPU visible to this Space," switch hardware to ZeroGPU (or any CUDA GPU tier) in Settings, or run:
python -c "from huggingface_hub import HfApi; HfApi().request_space_hardware('Darkweb007/cuda-kernels', 'zero-a10g')"Tab 1 details
Push any local folder to the Hugging Face Hub (model, dataset, or Space repo) without the CLI. Built to push long-context-attention-kernels and cuda-fusion-compiler up as Hub repos.
Setup
pip install -r requirements.txtGet a token with write access from https://huggingface.co/settings/tokens.
Run
python app.pyOpens a local Gradio UI at http://127.0.0.1:7860. You can either paste your token into the "HF Access Token" field each time, or set it once as an environment variable and leave the field blank:
export HF_TOKEN=hf_xxxxxxxxxxxx
python app.pyUsing it
- Click Check token to confirm you're authenticated.
- Fill in Repo ID as
your-username/repo-name. - Pick Repo type —
modelfor a kernels/code repo,datasetfor data,spaceif the folder includes anapp.pyyou want running live (Gradio Spaces auto-detectapp.py+requirements.txt, so this same tool could even push itself). - Point Local folder to push at the absolute path of the project directory (e.g. the
long-context-attention-kernelsfolder). - Click Push to Hugging Face. The repo is created if it doesn't exist (
exist_ok=True, so re-running is safe and just updates it), then the whole folder is uploaded in one commit.
The log panel shows progress and the final Hub URL. .git, __pycache__, build/, and compiled .so files are excluded automatically.
Notes
- This never deletes anything remotely;
upload_folderadds/updates files in the target repo. - For very large files (model checkpoints), Hugging Face Hub uses Git LFS —
upload_folderhandles this automatically for files it detects as large binaries. - Never commit a token into a repo. This app only ever holds it in memory for the current session.
