push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,92 @@
{
lib,
fetchFromGitHub,
fetchpatch,
rocmUpdateScript,
buildPythonPackage,
pytestCheckHook,
setuptools,
distro,
pyyaml,
msgpack,
pandas,
joblib,
filelock,
clr,
rich,
}:
buildPythonPackage rec {
pname = "tensile";
# Using a specific commit which has compression support from after the 6.4 release
# Without compression packages are too large for hydra
version = "6.4-unstable-2025-06-12";
format = "pyproject";
src = fetchFromGitHub {
owner = "ROCm";
repo = "Tensile";
rev = "1ce87a9fe73610ffb962082f0a882360cd39b103";
hash = "sha256-qIuoIbmridy1HQVV10qPTzbccuxNJPsOvePaQQnClZc=";
};
# TODO: It should be possible to run asm caps test ONCE for all supported arches
# We currently disable the test because it's slow and runs each time tensile launches
postPatch = ''
substituteInPlace Tensile/Common.py \
--replace-fail 'if globalParameters["AssemblerPath"] is not None:' "if False:"
# Add an assert that the fallback 9,0,0 is supported before setting the kernel to it
# If it's not detected as supported we have an issue with compiler paths or the compiler is broken
# and it's better to stop immediately
substituteInPlace Tensile/KernelWriter.py \
--replace-fail '= (9,0,0)' '= (9,0,0);assert(globalParameters["AsmCaps"][(9,0,0)]["SupportedISA"])'
find . -type f -iname "*.sh" -exec chmod +x {} \;
patchShebangs Tensile
'';
buildInputs = [ setuptools ];
propagatedBuildInputs = [
pyyaml
msgpack
pandas
joblib
distro
rich
];
patches = [
./tensile-solutionstructs-perf-fix.diff
./tensile-create-library-dont-copy-twice.diff
(fetchpatch {
# [PATCH] Extend Tensile HIP ISA compatibility
sha256 = "sha256-d+fVf/vz+sxGqJ96vuxe0jRMgbC5K6j5FQ5SJ1e3Sl8=";
url = "https://github.com/GZGavinZhao/Tensile/commit/855cb15839849addb0816a6dde45772034a3e41f.patch";
})
];
doCheck = false; # Too many errors, not sure how to set this up properly
nativeCheckInputs = [
pytestCheckHook
filelock
clr
];
env.ROCM_PATH = "${clr}";
pythonImportsCheck = [ "Tensile" ];
passthru.updateScript = rocmUpdateScript {
name = pname;
inherit (src) owner repo;
};
meta = with lib; {
description = "GEMMs and tensor contractions";
homepage = "https://github.com/ROCm/Tensile";
license = with licenses; [ mit ];
teams = [ teams.rocm ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,20 @@
diff --git a/Tensile/TensileCreateLibrary.py b/Tensile/TensileCreateLibrary.py
index a1644606..c6ca2882 100644
--- a/Tensile/TensileCreateLibrary.py
+++ b/Tensile/TensileCreateLibrary.py
@@ -852,9 +852,14 @@ def copyStaticFiles(outputPath=None):
"KernelHeader.h",
]
+ import filecmp
for fileName in libraryStaticFiles:
# copy file
- shutil.copy(os.path.join(globalParameters["SourcePath"], fileName), outputPath)
+ # no need to copy twice if it has already been copied
+ src = os.path.join(globalParameters["SourcePath"], fileName)
+ dst = os.path.join(outputPath, os.path.basename(src))
+ if not os.path.isfile(dst) or not filecmp.cmp(src, dst):
+ shutil.copyfile(src, dst)
return libraryStaticFiles

View File

@@ -0,0 +1,48 @@
diff --git a/Tensile/SolutionStructs.py b/Tensile/SolutionStructs.py
index f663c6f1..17bcf897 100644
--- a/Tensile/SolutionStructs.py
+++ b/Tensile/SolutionStructs.py
@@ -4828,24 +4828,26 @@ class Solution(collections.abc.Mapping):
# create a dictionary of lists of parameter values
@staticmethod
def getSerialNaming(objs):
+ valid_params = sorted(validParameters.keys())
data = {}
- for objIdx in range(0, len(objs)):
- obj = objs[objIdx]
- for paramName in sorted(obj.keys()):
- if paramName in list(validParameters.keys()):
- paramValue = obj[paramName]
- if paramName in data:
- if paramValue not in data[paramName]:
- data[paramName].append(paramValue)
- else:
- data[paramName] = [ paramValue ]
- maxObjs = 1
- for paramName in data:
- if not isinstance(data[paramName][0],dict):
- data[paramName] = sorted(data[paramName])
- maxObjs *= len(data[paramName])
- numDigits = len(str(maxObjs))
- return [ data, numDigits ]
+
+ objs = [getattr(obj, "_state", obj) for obj in objs]
+
+ for param in valid_params:
+ d = []
+ for obj in objs:
+ if param in obj:
+ v = obj[param]
+ if v not in d:
+ d.append(v)
+ if len(d):
+ if not isinstance(d[0], dict): d.sort()
+ data[param] = d
+
+ # Calculate max objects using prod() from math module
+ max_objs = math.prod(len(values) for values in data.values())
+ num_digits = len(str(max_objs))
+ return data, num_digits
########################################
# Get Name Serial