Skip to content

[docs] Add a Scheduling Halide Pipelines guide - #9435

Open
derek-gerstmann wants to merge 3 commits into
mainfrom
dg/scheduling_guide
Open

[docs] Add a Scheduling Halide Pipelines guide#9435
derek-gerstmann wants to merge 3 commits into
mainfrom
dg/scheduling_guide

Conversation

@derek-gerstmann

@derek-gerstmann derek-gerstmann commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Adds a new documentation guide, Scheduling Halide Pipelines, covering how
Halide pipelines are scheduled and the strategies, directives, and techniques
for optimizing performance for a target.

What's here

  • doc/SchedulingHalidePipelines.md — the guide's landing page: a four-part
    overview plus an annotated table of contents. Its 21 chapters live under
    doc/scheduling/. The four parts are:
    • Part I — The Model: the objects being scheduled, how a pipeline is
      realized, and bounds inference.
    • Part II — Scheduling for Performance: the shapes fast pipelines take on
      CPUs and GPUs, how to find what to fix, plus recipes and pitfalls.
    • Part III — Scheduling Directives: how to read a loop nest, then each
      directive and exactly what it does.
    • Part IV — Reference: a directive index, a pre-flight checklist, and a
      worked example.
  • Indexed in doc/guides.md.
  • Wired into the Sphinx docs build (doc/CMakeLists.txt): the landing page
    and every chapter are staged into the Sphinx source tree, and the chapters
    are pulled in via a hidden toctree on the landing page so they render into
    the website and appear in the navigation.

Testing

Built the documentation site locally with sphinx-build (exit 0, no warnings):
the landing page and all 21 chapters render, cross-links resolve, and the
chapters appear in the sidebar nav.

Docs-only change — no source, public-API, or Python-binding impact.

🤖 Generated with Claude Code

Co-authored-by: David Zhao Akeley 25728234+akeley98@users.noreply.github.com
Co-authored-by: Andrew Adams andrew.b.adams@gmail.com
Co-authored-by: Karima Ma 10568169+KarimaMa@users.noreply.github.com
Co-authored-by: Claude Opus 4.8 noreply@anthropic.com

Add a four-part guide to scheduling Halide pipelines as
doc/SchedulingHalidePipelines.md, with its chapters under doc/scheduling/.
It covers the scheduling model, scheduling for performance on CPUs and
GPUs, each scheduling directive, and a compact reference section.

Index the guide in doc/guides.md, and stage the landing page plus all of
its chapters into the Sphinx source tree (doc/CMakeLists.txt) so the `doc`
target renders them into the documentation website.

Co-authored-by: David Zhao Akeley <25728234+akeley98@users.noreply.github.com>
Co-authored-by: Andrew Adams <515398+abadams@users.noreply.github.com>
Co-authored-by: Karima Ma <10568169+KarimaMa@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@derek-gerstmann derek-gerstmann changed the title Add the Scheduling Halide Pipelines guide [docs] Add a Scheduling Halide Pipelines guide Sep 10, 2026
@derek-gerstmann derek-gerstmann added the documentation Missing, incorrect, or unclear. Spelling & grammar mistakes. label Sep 10, 2026
@alexreinking

alexreinking commented Sep 10, 2026

Copy link
Copy Markdown
Member

This seems like almost the exact structure of a Claude/agent skill. Should we add a .claude/skills/scheduling/SKILL.md that tells Claude to read this guide when asked to schedule something?

@alexreinking

Copy link
Copy Markdown
Member

Also, is the point of this to be AI-readable first or human-readable first? There is a lot of AI-ese in there.

@derek-gerstmann

Copy link
Copy Markdown
Contributor Author

Yes, adding a Claude SKILL.md that says to read this guide would be a great addition.

The intent was to make it user readable, but I rewrote it and reformatted it from a distillation of LLM specific docs, so there are definitely still leftover snippets that could use some rewording, adjustments. But we felt it was complete enough to open a PR to get comments, edits, feedback, etc.

@alexreinking

Copy link
Copy Markdown
Member

For other reviewers, the link to the rendered Markdown is here: https://github.com/halide/Halide/blob/dg/scheduling_guide/doc/SchedulingHalidePipelines.md

Add .claude/skills/scheduling/: a Claude Code skill whose description routes
Halide schedule-optimization tasks into the Scheduling Halide Pipelines guide,
plus a bundled quick-reference cheat sheet (references/directive-cheatsheet.md)
covering every directive, the tail strategies, and common gotchas.

Skill manifests must open with a YAML frontmatter block, which none of
mdformat's configured plugins understand -- left alone it rewrites the `---`
fences and mangles the metadata. Exclude SKILL.md from the mdformat pre-commit
hook so the manifest survives `pre-commit run --all-files`.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@derek-gerstmann

derek-gerstmann commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Added Claude SKILL.md. It also recommended a references/directives-cheatsheet.md.

Rename doc/scheduling/08-benchmarking-and-the-profiler.md to
08-benchmarking-and-profiling.md and retitle it "Benchmarking & Profiling",
updating the toctree, the CMake staging list, and every cross-reference.

Document HL_PROFILER_JSON_OUTPUT for capturing the profile as JSON, and timing
the pipeline single-threaded (HL_NUM_THREADS=1 or halide_set_num_threads(1)) to
check how well a schedule scales with cores. Tighten the prose to match the
introduction's style.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.88%. Comparing base (a95f4de) to head (5a2795a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9435      +/-   ##
==========================================
- Coverage   70.07%   69.88%   -0.20%     
==========================================
  Files         261      261              
  Lines       79462    79462              
  Branches    19365    19365              
==========================================
- Hits        55684    55531     -153     
- Misses      17908    17965      +57     
- Partials     5870     5966      +96     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Missing, incorrect, or unclear. Spelling & grammar mistakes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants