Add doc build to CI (#119)

* Add doc build to CI

* Trigger doc build

* No path scoping
This commit is contained in:
Daniël de Kok
2025-07-29 16:01:05 +02:00
committed by GitHub
parent f7490bd0a9
commit 6fbff7a9cb
4 changed files with 51 additions and 3 deletions

View File

@ -0,0 +1,17 @@
name: Build documentation
on:
push:
branches:
- main
- doc-builder*
- v*-release
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_main_documentation.yml@main
with:
commit_sha: ${{ github.sha }}
package: kernels
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}

View File

@ -0,0 +1,15 @@
name: Build PR Documentation
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/build_pr_documentation.yml@main
with:
commit_sha: ${{ github.event.pull_request.head.sha }}
pr_number: ${{ github.event.number }}
package: kernels

View File

@ -0,0 +1,16 @@
name: Upload PR Documentation
on:
workflow_run:
workflows: ["Build PR Documentation"]
types:
- completed
jobs:
build:
uses: huggingface/doc-builder/.github/workflows/upload_pr_documentation.yml@main
with:
package_name: kernels
secrets:
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}

View File

@ -2,9 +2,9 @@
## Why is the kernelization step needed? ## Why is the kernelization step needed?
In earlier versions of `kernels`, a layer's `forward` was replaced by In earlier versions of `kernels`, a layer's `forward` method was replaced
`use_kernel_forward_from_hub` and `replace_kernel_forward_from_hub`. The by `use_kernel_forward_from_hub` and `replace_kernel_forward_from_hub`.
new `forward` would dispatch to a kernel based on the device type, The new `forward` would dispatch to a kernel based on the device type,
whether a model was training, etc. However, this approach was whether a model was training, etc. However, this approach was
fundamentally incompatible with `torch.compile` since it relied fundamentally incompatible with `torch.compile` since it relied
on data-dependent branching. on data-dependent branching.