Skip to content

Conversation

@oraluben
Copy link
Contributor

@oraluben oraluben commented Oct 14, 2025

This enable to run faster recompile without heavy pip install.

Add log to reduce ambiguity:

$ python -c 'import tilelang'
2025-10-14 11:11:29  [TileLang:tilelang.env:WARNING]: Loading tilelang libs from dev root: /Users/yyc/repo/tilelang/build

Also add torch requirement for metal as in #1021 (comment)

Summary by CodeRabbit

  • New Features

    • Automatic developer-mode fallback when local third-party libraries are missing, with warnings and validation to ensure required libraries are found.
  • Documentation

    • Added a “Faster rebuild for developers” section with editable-install and quicker iterative build guidance; removed outdated build notes.
  • Chores

    • Disabled backtrace integration when Metal support is active.
    • macOS builds now require PyTorch >= 2.7.
    • Added scikit-build-core to developer requirements.

@github-actions
Copy link

👋 Hi! Thank you for contributing to the TileLang project.

Please remember to run pre-commit run --all-files in the root directory of the project to ensure your changes are properly linted and formatted. This will help ensure your contribution passes the format check.

We appreciate you taking this step! Our team will review your contribution, and we look forward to your awesome work! 🚀

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Updates build config (disable libbacktrace when USE_METAL; Darwin requires torch>=2.7; add scikit-build-core), expands installation docs with a faster developer rebuild workflow, and changes env.py to derive a development THIRD_PARTY_ROOT with warning and an assertion when libs are missing.

Changes

Cohort / File(s) Summary
Build configuration
CMakeLists.txt, pyproject.toml, requirements-dev.txt
CMakeLists.txt: when USE_METAL is active, preserves metal source collection, adds a comment, and sets TVM_FFI_USE_LIBBACKTRACE OFF. pyproject.toml: adds torch>=2.7; platform_system == 'Darwin'. requirements-dev.txt: adds scikit-build-core.
Documentation
docs/get_started/Installation.md
Removes two lines about ffi/cython/dlpack and --no-build-isolation; adds a “Faster rebuild for developers” section with dev install commands (pip install -r requirements-dev.txt, pip install -e . -v --no-build-isolation), a cd build; ninja dev-mode workflow, and an example log snippet.
Runtime environment handling
tilelang/env.py
If THIRD_PARTY_ROOT is missing, derive a dev root from TL_ROOT, set THIRD_PARTY_ROOT to the dev 3rdparty path, define TL_LIBS to include dev build locations (including a tvm subpath), emit a warning about loading from the dev root, and assert that at least one TL_LIBS path exists.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Dev as Developer
  participant App as Application
  participant Env as tilelang.env
  participant FS as FileSystem

  Dev->>App: Start / import
  App->>Env: Load env.py
  Env->>FS: Check THIRD_PARTY_ROOT exists?
  alt present
    Env-->>App: Use THIRD_PARTY_ROOT and TL_LIBS
  else missing
    rect rgb(230,245,255)
    note right of Env: Development-mode resolution (new)
    Env->>FS: Derive dev_root from TL_ROOT
    Env->>FS: Compute dev_lib_root and tvm subpath
    Env-->>Env: Set THIRD_PARTY_ROOT = dev 3rdparty path
    Env-->>Env: Define TL_LIBS = [dev_lib_root, dev_lib_root/tvm, ...]
    Env->>FS: Assert any(path in TL_LIBS exists)
    end
    Env-->>App: Emit warning and provide TL_LIBS
  end
  App-->>Dev: Continue init
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I twitch my ears at CMake’s hum,
Dev roots sprout where builds become.
Docs now sprint, rebuilds take flight—
Darwin Torch joins the night.
I thump a paw and grin with glee, “Hop on, compile with me!” 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title clearly and concisely describes the primary change of preferring libraries from the local build directory, directly reflecting the main objective of loading TileLang libs from the dev build path for faster iteration.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (3)
pyproject.toml (1)

40-41: Consider consolidating the torch dependency.

Both "torch" and "torch>=2.7; platform_system == 'Darwin'" appear in the dependencies list. On Darwin systems, both will be evaluated, making the first line redundant.

Consider replacing both lines with a single conditional dependency for clarity:

-    "torch",
-    "torch>=2.7; platform_system == 'Darwin'"
+    "torch>=2.7; platform_system == 'Darwin'",
+    "torch; platform_system != 'Darwin'"

This makes the platform-specific requirement explicit and avoids redundancy.

docs/get_started/Installation.md (2)

259-264: Add language specifier to the code block.

As per coding guidelines (markdownlint MD040), fenced code blocks should specify a language for proper syntax highlighting.

Apply this diff:

-```
+```bash
 pip install -r requirements-dev.txt
 pip install -e . -v --no-build-isolation
 
 cd build; ninja

---

`268-271`: **Add language specifier to the console output block.**

As per coding guidelines (markdownlint MD040), fenced code blocks should specify a language. Use `console` or `bash` for command output.



Apply this diff:

```diff
-```
+```console
 $ python -c 'import tilelang'
 2025-10-14 11:11:29  [TileLang:tilelang.env:WARNING]: Loading tilelang libs from dev root: /Users/yyc/repo/tilelang/build

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 7a5077e4aa8e30533b6fe1f0716b2c28cf6f661b and d944c58a7f44b885f05f63b4ee462bdce633dd76.

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `CMakeLists.txt` (1 hunks)
* `docs/get_started/Installation.md` (1 hunks)
* `pyproject.toml` (1 hunks)
* `requirements-dev.txt` (1 hunks)
* `tilelang/env.py` (1 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

<details>
<summary>docs/get_started/Installation.md</summary>

259-259: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

268-268: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)</summary>

* GitHub Check: build-test-amd
* GitHub Check: format-check

</details>

<details>
<summary>🔇 Additional comments (3)</summary><blockquote>

<details>
<summary>requirements-dev.txt (1)</summary><blockquote>

`8-8`: **LGTM!**

The addition of `scikit-build-core` aligns with the build system requirements defined in `pyproject.toml` and supports the faster developer rebuild workflow.

</blockquote></details>
<details>
<summary>tilelang/env.py (1)</summary><blockquote>

`34-41`: **LGTM! Development mode logic is correct.**

The code appropriately switches to development mode when the 3rdparty root is missing:

1. Computes the dev library root from the parent directory
2. Sets `TL_LIBS` to prefer local build directories over installed packages
3. Updates `THIRD_PARTY_ROOT` to point to the development 3rdparty location
4. Emits a clear warning message for debugging
5. Asserts that at least one library path exists, preventing silent failures

This implementation aligns well with the PR objective of enabling faster recompilation for developers.



**Note:** In development mode (line 37), `TL_LIBS` is completely replaced, ignoring any site-packages paths that were set on lines 25-26. This is intentional and correct for the dev workflow.

</blockquote></details>
<details>
<summary>CMakeLists.txt (1)</summary><blockquote>

`78-79`: **Confirm disabling libbacktrace is an acceptable fix**

The FIXME tags a temporary workaround for CIBW wheel failures; disabling backtrace support may degrade debugging in Metal builds. Investigate why CIBW fails with libbacktrace enabled (missing dependency, Metal toolchain incompatibility, or packaging issue) and restore libbacktrace once resolved.

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
docs/get_started/Installation.md (1)

259-271: Add languages to the new code fences.

markdownlint (MD040) flags these fences for missing language identifiers. Annotating them keeps the docs lint‑clean and improves syntax highlighting.

Apply this diff:

-```
+```bash
 pip install -r requirements-dev.txt
 pip install -e . -v --no-build-isolation
 
 cd build; ninja

When running in editable/developer mode,
you'll see similar logs like below:
- +console
$ python -c 'import tilelang'
2025-10-14 11:11:29 [TileLang:tilelang.env:WARNING]: Loading tilelang libs from dev root: /Users/yyc/repo/tilelang/build

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d944c58 and c95a8e8.

📒 Files selected for processing (1)
  • docs/get_started/Installation.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/get_started/Installation.md

259-259: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


268-268: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-test-metal
  • GitHub Check: build-test-amd
  • GitHub Check: format-check

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c95a8e8 and c3ede0f.

📒 Files selected for processing (1)
  • docs/get_started/Installation.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/get_started/Installation.md

259-259: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


268-268: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-test-amd
  • GitHub Check: format-check

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cca9d7 and 9acd7dc.

📒 Files selected for processing (1)
  • docs/get_started/Installation.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build-test-amd
  • GitHub Check: format-check
  • GitHub Check: format-check

@LeiWang1999 LeiWang1999 merged commit 0f515b8 into tile-ai:main Oct 14, 2025
9 of 10 checks passed
@oraluben oraluben deleted the prefer-build-lib branch October 14, 2025 06:25
RubiaCx pushed a commit to RubiaCx/tilelang that referenced this pull request Nov 24, 2025
* Load libs from build dir, if present, to support faster rebuild.

* typo

* upd

* refine check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants