Unverified Commit ca1138c3 authored by Lei Wang's avatar Lei Wang Committed by GitHub
Browse files

[Refactor] Phaseout version with commit id in editable model (#677)



* merge from lab

* Add `TILELANG_PRINT_ON_COMPILATION`

* Update CI workflow to disable build isolation for pip installations in testing requirements

- Changed the `PIP_NO_BUILD_ISOLATION` environment variable from `1` to `0` in the CI configuration, ensuring that pip installs the testing requirements without build isolation. This adjustment aims to improve compatibility and streamline the installation process during CI runs.

---------
Co-authored-by: default avatarChenggang Zhao <chenggangz@deepseek.com>
parent 4878cc5d
......@@ -42,7 +42,7 @@ jobs:
source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate"
python -m pip install --upgrade pip --no-user
[[ -f requirements-test.txt ]] && \
PIP_NO_BUILD_ISOLATION=1 pip install -r requirements-test.txt --no-user
PIP_NO_BUILD_ISOLATION=0 pip install -r requirements-test.txt --no-user
pip install . --no-user
touch "$MARKER"
fi
......@@ -97,7 +97,7 @@ jobs:
source "${{ runner.tool_cache }}/${{ env.VENV_DIR }}/bin/activate"
python -m pip install --upgrade pip --no-user
[[ -f requirements-test.txt ]] && \
PIP_NO_BUILD_ISOLATION=1 pip install -r requirements-test.txt --no-user
PIP_NO_BUILD_ISOLATION=0 pip install -r requirements-test.txt --no-user
pip install . --no-user
touch "$MARKER"
fi
......
......@@ -75,6 +75,9 @@ TILELANG_CACHE_DIR: str = os.environ.get("TILELANG_CACHE_DIR",
os.path.expanduser("~/.tilelang/cache"))
TILELANG_TMP_DIR: str = os.path.join(TILELANG_CACHE_DIR, "tmp")
# Print the kernel name on every compilation
TILELANG_PRINT_ON_COMPILATION: str = os.environ.get("TILELANG_PRINT_COMPILATION", "0")
# Auto-clear cache if environment variable is set
TILELANG_CLEAR_CACHE = os.environ.get("TILELANG_CLEAR_CACHE", "0")
......
......@@ -6,6 +6,7 @@ from tvm.tir import PrimFunc
import tilelang
from tilelang import tvm as tvm
from tilelang.engine.param import CompiledArtifact, KernelParam
from tilelang.env import TILELANG_PRINT_ON_COMPILATION
from tilelang.jit.adapter import (BaseKernelAdapter, CtypesKernelAdapter, CythonKernelAdapter,
NVRTCKernelAdapter, TorchDLPackKernelAdapter)
from tilelang.profiler import Profiler, TensorSupplyType
......@@ -110,6 +111,12 @@ class JITKernel(object):
if from_database:
return
# Print log on compilation starts
# NOTE(Chenggang): printing could let the training/inference framework easier to know
# whether the communication timeout is from compilation
if TILELANG_PRINT_ON_COMPILATION.lower() in ("1", "true", "yes", "on"):
print(f"TileLang begins to compile kernel `{func.__name__}` with `{out_idx=}`")
# Compile the TileLang function and create a kernel adapter for execution.
adapter = self._compile_and_create_adapter(func, out_idx)
......
......@@ -24,24 +24,5 @@ else:
with open(version_file_path, "r") as version_file:
__version__ = version_file.read().strip()
def get_git_commit_id() -> Union[str, None]:
"""Get the current git commit hash.
Returns:
str | None: The git commit hash if available, None otherwise.
"""
try:
return subprocess.check_output(['git', 'rev-parse', 'HEAD'],
stderr=subprocess.DEVNULL,
encoding='utf-8').strip()
except subprocess.SubprocessError:
return None
# Append git commit hash to version if not already present
if "+" not in __version__ and (commit_id := get_git_commit_id()):
__version__ = f"{__version__}+{commit_id}"
# Define the public API for the module
__all__ = ["__version__"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment