Skip to content

Commit

Permalink
[ENH] Improve packaging of benchmarks (#2572)
Browse files Browse the repository at this point in the history
Add proper versioning and install requirements.
  • Loading branch information
vlad-penkin authored Oct 25, 2024
1 parent be47a27 commit c05fe4f
Showing 1 changed file with 34 additions and 8 deletions.
42 changes: 34 additions & 8 deletions benchmarks/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,37 @@ def run(self):
super().run()


setup(name="triton-kernels-benchmark", packages=[
"triton_kernels_benchmark",
], package_dir={
"triton_kernels_benchmark": "triton_kernels_benchmark",
}, package_data={"triton_kernels_benchmark": ["xetla_kernel.cpython-*.so"]}, cmdclass={
"build_ext": build_ext,
"clean": clean,
}, ext_modules=[CMakeExtension("triton_kernels_benchmark")])
def get_git_commit_hash(length=8):
try:
cmd = ["git", "rev-parse", f"--short={length}", "HEAD"]
return f"+git{subprocess.check_output(cmd).strip().decode('utf-8')}"
except (
FileNotFoundError,
subprocess.CalledProcessError,
subprocess.TimeoutExpired,
):
return ""


setup(
name="triton-kernels-benchmark",
version="3.1.0" + get_git_commit_hash(),
packages=["triton_kernels_benchmark"],
install_requires=[
"torch",
"pandas",
"tabulate",
"matplotlib",
],
package_dir={"triton_kernels_benchmark": "triton_kernels_benchmark"},
package_data={"triton_kernels_benchmark": ["xetla_kernel.cpython-*.so"]},
cmdclass={
"build_ext": build_ext,
"clean": clean,
},
ext_modules=[CMakeExtension("triton_kernels_benchmark")],
extra_require={
"ipex": ["numpy<=2.0", "intel-extension-for-pytorch=2.1.10"],
"pytorch": ["torch>=2.6"],
},
)

0 comments on commit c05fe4f

Please sign in to comment.