-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
python3Packages.triton*: 2.1.0 -> 3.0.0 #328247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b8e2221
5ed0e25
e262792
ae56006
2aa951f
0daa241
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| From c5d4087519eae6f41c80bbd8ffbcc9390db44c7f Mon Sep 17 00:00:00 2001 | ||
| From: SomeoneSerge <else+aalto@someonex.net> | ||
| Date: Thu, 10 Oct 2024 19:19:18 +0000 | ||
| Subject: [PATCH] cmake.py: propagate cmakeFlags from environment | ||
|
|
||
| --- | ||
| tools/setup_helpers/cmake.py | 6 ++++++ | ||
| 1 file changed, 6 insertions(+) | ||
|
|
||
| diff --git a/tools/setup_helpers/cmake.py b/tools/setup_helpers/cmake.py | ||
| index 4b605fe5975..ea1d6a1ef46 100644 | ||
| --- a/tools/setup_helpers/cmake.py | ||
| +++ b/tools/setup_helpers/cmake.py | ||
| @@ -332,6 +332,12 @@ class CMake: | ||
| file=sys.stderr, | ||
| ) | ||
| print(e, file=sys.stderr) | ||
| + | ||
| + # Nixpkgs compat: | ||
| + if "cmakeFlags" in os.environ: | ||
| + import shlex | ||
| + args.extend(shlex.split(os.environ["cmakeFlags"])) | ||
| + | ||
| # According to the CMake manual, we should pass the arguments first, | ||
| # and put the directory as the last element. Otherwise, these flags | ||
| # may not be passed correctly. | ||
| -- | ||
| 2.46.0 | ||
|
|
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| From 2751c5de5c61c90b56e3e392a41847f4c47258fd Mon Sep 17 00:00:00 2001 | ||
| From: SomeoneSerge <else+aalto@someonex.net> | ||
| Date: Sun, 13 Oct 2024 14:16:48 +0000 | ||
| Subject: [PATCH 1/3] _build: allow extra cc flags | ||
|
|
||
| --- | ||
| python/triton/runtime/build.py | 10 +++++++++- | ||
| 1 file changed, 9 insertions(+), 1 deletion(-) | ||
|
|
||
| diff --git a/python/triton/runtime/build.py b/python/triton/runtime/build.py | ||
| index d7baeb286..d334dce77 100644 | ||
| --- a/python/triton/runtime/build.py | ||
| +++ b/python/triton/runtime/build.py | ||
| @@ -42,9 +42,17 @@ def _build(name, src, srcdir, library_dirs, include_dirs, libraries): | ||
| py_include_dir = sysconfig.get_paths(scheme=scheme)["include"] | ||
| include_dirs = include_dirs + [srcdir, py_include_dir] | ||
| cc_cmd = [cc, src, "-O3", "-shared", "-fPIC", "-o", so] | ||
| + | ||
| + # Nixpkgs support branch | ||
| + # Allows passing e.g. extra -Wl,-rpath | ||
| + cc_cmd_extra_flags = "@ccCmdExtraFlags@" | ||
| + if cc_cmd_extra_flags != ("@" + "ccCmdExtraFlags@"): # substituteAll hack | ||
| + import shlex | ||
| + cc_cmd.extend(shlex.split(cc_cmd_extra_flags)) | ||
| + | ||
| cc_cmd += [f'-l{lib}' for lib in libraries] | ||
| cc_cmd += [f"-L{dir}" for dir in library_dirs] | ||
| - cc_cmd += [f"-I{dir}" for dir in include_dirs] | ||
| + cc_cmd += [f"-I{dir}" for dir in include_dirs if dir is not None] | ||
| ret = subprocess.check_call(cc_cmd) | ||
| if ret == 0: | ||
| return so | ||
| -- | ||
| 2.46.0 | ||
|
|
This file was deleted.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| From 587d1f3428eca63544238802f19e0be670d03244 Mon Sep 17 00:00:00 2001 | ||
| From: SomeoneSerge <else@someonex.net> | ||
| Date: Mon, 29 Jul 2024 14:31:11 +0000 | ||
| Subject: [PATCH] setup.py: introduce TRITON_OFFLINE_BUILD | ||
|
|
||
| To prevent any vendoring whatsoever | ||
| --- | ||
| python/setup.py | 26 ++++++++++++++++++++++++-- | ||
| 1 file changed, 24 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/python/setup.py b/python/setup.py | ||
| index 73800ec40..4e5b04de4 100644 | ||
| --- a/python/setup.py | ||
| +++ b/python/setup.py | ||
| @@ -112,6 +112,20 @@ def get_env_with_keys(key: list): | ||
| return os.environ[k] | ||
| return "" | ||
|
|
||
| +def is_offline_build() -> bool: | ||
| + """ | ||
| + Downstream projects and distributions which bootstrap their own dependencies from scratch | ||
| + and run builds in offline sandboxes | ||
| + may set `TRITON_OFFLINE_BUILD` in the build environment to prevent any attempts at downloading | ||
| + pinned dependencies from the internet or at using dependencies vendored in-tree. | ||
| + | ||
| + Dependencies must be defined using respective search paths (cf. `syspath_var_name` in `Package`). | ||
| + Missing dependencies lead to an early abortion. | ||
| + Dependencies' compatibility is not verified. | ||
| + | ||
| + Note that this flag isn't tested by the CI and does not provide any guarantees. | ||
| + """ | ||
| + return os.environ.get("TRITON_OFFLINE_BUILD", "") != "" | ||
|
|
||
| # --- third party packages ----- | ||
|
|
||
| @@ -220,8 +234,14 @@ def get_thirdparty_packages(packages: list): | ||
| if os.environ.get(p.syspath_var_name): | ||
| package_dir = os.environ[p.syspath_var_name] | ||
| version_file_path = os.path.join(package_dir, "version.txt") | ||
| - if p.syspath_var_name not in os.environ and\ | ||
| - (not os.path.exists(version_file_path) or Path(version_file_path).read_text() != p.url): | ||
| + | ||
| + input_defined = p.syspath_var_name not in os.environ | ||
| + input_exists = input_defined and os.path.exists(version_file_path) | ||
| + input_compatible = input_exists and Path(version_file_path).read_text() == p.url | ||
| + | ||
| + if is_offline_build() and not input_defined: | ||
| + raise RuntimeError(f"Requested an offline build but {p.syspath_var_name} is not set") | ||
| + if not is_offline_build() and not input_compatible: | ||
| with contextlib.suppress(Exception): | ||
| shutil.rmtree(package_root_dir) | ||
| os.makedirs(package_root_dir, exist_ok=True) | ||
| @@ -245,6 +265,8 @@ def get_thirdparty_packages(packages: list): | ||
|
|
||
|
|
||
| def download_and_copy(name, src_path, variable, version, url_func): | ||
| + if is_offline_build(): | ||
| + return | ||
|
||
| triton_cache_path = get_triton_cache_path() | ||
| if variable in os.environ: | ||
| return | ||
| -- | ||
| 2.45.1 | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.