the big Intel garbage dump

contains slop
This commit is contained in:
TheK0tYaRa 2026-04-20 19:30:35 +03:00
parent c2111878df
commit 41c750e93f
21 changed files with 477 additions and 15 deletions

View file

@ -1,2 +1,4 @@
DIST intel-compute-runtime-25.18.33578.42.tar.gz 7712468 BLAKE2B 12f87427aaf5710f67060f394464d6cfd4602c0dcaebba558e7988a814e645ee09877de1484dbd28786aaecb54dfe9f778a4182780ecf5f5701acda2cfcd2f36 SHA512 786a3f5e21f6503877e2b3b499dbfebdbde50c50da9ded5f4970092af89ad6d32f3abd89af2c23431bbfdecaee040ec2db12b9737fc86ff333ef00838b7ec962
DIST intel-compute-runtime-25.35.35096.9.tar.gz 8167540 BLAKE2B 290838ba19e7f33f339b122c2db7f0b82cd2de593d340ad918c93cda465fee132e5ebab3da70c1804500fd03742ea3a931504a080d272561909d78a252f0c001 SHA512 0d1a79a27505576a0f99a3f0e28010c3f5201d54add3684215728652a92bc6b11306a33d7d871dd50c0e8377bdc5fb886a247210e1e8db2634802447db91edd0
DIST intel-compute-runtime-26.09.37435.10.tar.gz 8834318 BLAKE2B 85240f23ae7ec111f9be26112ff639f59e182aed8ad34dd465b42c9bd13c869df76a8e3efdf181b2e5dfe848f21c346803795b9ed3eefaa317986d65b16a53e1 SHA512 b28ceedf42fc5114700db0665593d82e1e503fa46baaf3a2be12258b7e9949c0b94304b0a67f99015469979935d3d8692a0a641cb2c0c8718cecced9b0737f7b
DIST intel-compute-runtime-26.14.37833.4.tar.gz 8912774 BLAKE2B 76120c924c73130b6b982f69e7100e3700a9e71c5fdcb51a7be1aea850c2a9a0f08280719d8a81df1c51ac192b30ffe59c40d3ad831989bca9ab33ff3f9a85b4 SHA512 7b0625d0e85f0b55cd7c53dc37cdb9d4cee774bb3722f5a140e6f257fca1779f90354bf2ac4d3a37e809b9537f19701a4077f02ceae18debb4cedcec07b83bed

View file

@ -72,6 +72,7 @@ src_configure() {
-DNEO_ALLOW_LEGACY_PLATFORMS_SUPPORT="ON"
-DNEO_DISABLE_LTO="ON"
-DNEO_DISABLE_MITIGATIONS="$(usex disable-mitigations)"
-DNEO_BUILD_UNVERSIONED_OCLOC="ON"
-DNEO__METRICS_LIBRARY_INCLUDE_DIR="${ESYSROOT}/usr/include"
-DKHRONOS_GL_HEADERS_DIR="${ESYSROOT}/usr/include"
-DOCL_ICD_VENDORDIR="${EPREFIX}/etc/OpenCL/vendors"

View file

@ -81,6 +81,7 @@ src_configure() {
-DNEO_ALLOW_LEGACY_PLATFORMS_SUPPORT="$(usex legacy)"
-DNEO_DISABLE_LTO="$(usex !lto)"
-DNEO_DISABLE_MITIGATIONS="$(usex disable-mitigations)"
-DNEO_BUILD_UNVERSIONED_OCLOC="ON"
-DNEO_ENABLE_REFERENCE_TRACKING="OFF"
-DNEO__METRICS_LIBRARY_INCLUDE_DIR="${ESYSROOT}/usr/include"
-DKHRONOS_GL_HEADERS_DIR="${ESYSROOT}/usr/include"

View file

@ -0,0 +1,117 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CMAKE_BUILD_TYPE="Release"
MY_PN="${PN/intel-/}"
MY_P="${MY_PN}-${PV}"
inherit cmake flag-o-matic
DESCRIPTION="Intel Graphics Compute Runtime for oneAPI Level Zero and OpenCL Driver"
HOMEPAGE="https://github.com/intel/compute-runtime"
SRC_URI="https://github.com/intel/${MY_PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/${MY_P}"
LICENSE="MIT"
SLOT="0/1.6.$(ver_cut 3)"
KEYWORDS="~amd64"
IUSE="disable-mitigations +l0 +vaapi test"
RDEPEND="
!dev-libs/intel-compute-runtime:legacy
>=dev-util/intel-graphics-compiler-2.32.7:0
!dev-util/intel-graphics-compiler:legacy
>=media-libs/gmmlib-22.7.1:=
"
DEPEND="
${RDEPEND}
dev-libs/intel-metrics-discovery:=
>=dev-libs/intel-metrics-library-1.0.200:=
dev-libs/libnl:3
dev-libs/libxml2:2
>=dev-util/intel-graphics-system-controller-0.9.6:=
media-libs/mesa
>=virtual/opencl-3
l0? ( >=dev-libs/level-zero-1.24.2:= )
vaapi? (
x11-libs/libdrm[video_cards_intel]
media-libs/libva
)
"
BDEPEND="virtual/pkgconfig"
DOCS=( "README.md" "FAQ.md" )
PATCHES=(
"${FILESDIR}/25.40.9999-${PN}-test.patch"
)
src_prepare() {
# Remove '-Werror' from default
sed -e '/Werror/d' -i CMakeLists.txt || die
# Current local ocloc backend trips on SPIR-V helper intrinsics lowered from
# vload4/vstore4 in builtins. Rewrite to scalar-equivalent OpenCL code so
# same functionality compiles without those helper references.
perl -0pi -e 's@uint4 loaded = vload4\(gid, pSrc\);@const idx_t base = gid << 2;\n uint4 loaded = (uint4)(pSrc[base + 0], pSrc[base + 1], pSrc[base + 2], pSrc[base + 3]);@g; s@const uint4 src0 = vload4\(gid, pSrc\);@const idx_t base = gid << 2;\n const uint4 src0 = (uint4)(pSrc[base + 0], pSrc[base + 1], pSrc[base + 2], pSrc[base + 3]);@g; s@const uint4 src1 = vload4\(\(gid \+ 1\), pSrc\);@const uint4 src1 = (uint4)(pSrc[base + 4], pSrc[base + 5], pSrc[base + 6], pSrc[base + 7]);@g; s@vstore4\(loaded, gid, pDst\);@pDst[base + 0] = loaded.x;\n pDst[base + 1] = loaded.y;\n pDst[base + 2] = loaded.z;\n pDst[base + 3] = loaded.w;@g; s@vstore4\(result, gid, pDst\);@pDst[base + 0] = result.x;\n pDst[base + 1] = result.y;\n pDst[base + 2] = result.z;\n pDst[base + 3] = result.w;@g; s@uint4 loaded = vload4\(gid, pSrcWithOffset\);@const idx_t base = gid << 2;\n uint4 loaded = (uint4)(pSrcWithOffset[base + 0], pSrcWithOffset[base + 1], pSrcWithOffset[base + 2], pSrcWithOffset[base + 3]);@g; s@vstore4\(loaded, gid, pDstWithOffset\);@pDstWithOffset[base + 0] = loaded.x;\n pDstWithOffset[base + 1] = loaded.y;\n pDstWithOffset[base + 2] = loaded.z;\n pDstWithOffset[base + 3] = loaded.w;@g' \
shared/source/built_ins/kernels/copy_buffer_to_buffer.builtin_kernel || die
perl -0pi -e 's@uint4 loaded = vload4\(gid, src\);@const unsigned int base = gid << 2;\n uint4 loaded = (uint4)(src[base + 0], src[base + 1], src[base + 2], src[base + 3]);@g; s@vstore4\(loaded, gid, dst\);@dst[base + 0] = loaded.x;\n dst[base + 1] = loaded.y;\n dst[base + 2] = loaded.z;\n dst[base + 3] = loaded.w;@g' \
shared/source/built_ins/kernels/aux_translation.builtin_kernel || die
perl -0pi -e 's@uint4 loaded = vload4\(x, src\);@const idx_t base = x << 2;\n uint4 loaded = (uint4)(src[base + 0], src[base + 1], src[base + 2], src[base + 3]);@g; s@vstore4\(loaded, x, dst\);@dst[base + 0] = loaded.x;\n dst[base + 1] = loaded.y;\n dst[base + 2] = loaded.z;\n dst[base + 3] = loaded.w;@g' \
shared/source/built_ins/kernels/copy_buffer_rect.builtin_kernel || die
perl -0pi -e 's@std::basic_string<unsigned char> pString = glGetStringi\(GL_EXTENSIONS, i\);@std::string pString = reinterpret_cast<const char *>(glGetStringi(GL_EXTENSIONS, i));@; s@if \(pString == pExtensionString\)@if (pString == reinterpret_cast<const char *>(pExtensionString))@; s@std::basic_string<unsigned char> vendor = glGetString\(GL_VENDOR\);@std::string vendor = reinterpret_cast<const char *>(glGetString(GL_VENDOR));@; s@std::basic_string<unsigned char> version = glGetString\(GL_VERSION\);@std::string version = reinterpret_cast<const char *>(glGetString(GL_VERSION));@; s@const unsigned char intelVendor\[\] = "Intel";@const char intelVendor[] = "Intel";@; s@const unsigned char versionES\[\] = "OpenGL ES";@const char versionES[] = "OpenGL ES";@; s@const unsigned char versionES1\[\] = "OpenGL ES 1\.";@const char versionES1[] = "OpenGL ES 1.";@; s@const unsigned char supportGLOES\[\] = "GL_OES_framebuffer_object";@const unsigned char supportGLOES[] = "GL_OES_framebuffer_object";@; s@const unsigned char supportGLEXT\[\] = "GL_EXT_framebuffer_object";@const unsigned char supportGLEXT[] = "GL_EXT_framebuffer_object";@' \
opencl/source/sharings/gl/linux/gl_sharing_linux.cpp || die
perl -0pi -e 's@#include <cstdint>@#include <cstdint>\n#include <mutex>@; s@namespace std \{\nclass mutex;\n\}\n@@' \
level_zero/core/source/kernel/kernel_shared_state.h || die
perl -0pi -e 's@vstore2\(sum, gid, dst\);@const size_t base = gid << 1;\n dst[base + 0] = sum.x;\n dst[base + 1] = sum.y;@' \
opencl/test/unit_test/test_files/simple_kernels.cl || die
perl -0pi -e 's@__global volatile atomic_int \*atomic_dst = \( __global volatile atomic_int \* \)dst;\n atomic_fetch_add_explicit\( &atomic_dst\[atomicOffset\], 1 , memory_order_relaxed, memory_scope_all_svm_devices \);@atomic_add((volatile __global int *)&dst[atomicOffset], 1);@' \
opencl/test/unit_test/test_files/simple_nonuniform.cl || die
sed -i \
-e '/file(GLOB_RECURSE TEST_KERNELS test_files\/\*\.cl)/a\list(REMOVE_ITEM TEST_KERNELS "${CMAKE_CURRENT_SOURCE_DIR}/test_files/simple_nonuniform.cl")\nset(TEST_KERNEL_nonuniform test_files/simple_nonuniform.cl)\nset(TEST_KERNEL_nonuniform_options "-cl-std=CL1.2")' \
-e '/neo_gen_kernels_with_options(${PLATFORM_IT_LOWER} ${DEVICE_ID} ${REVISION_ID} ${TEST_KERNEL} ${TEST_KERNEL_options})/a\ neo_gen_kernels_with_options(${PLATFORM_IT_LOWER} ${DEVICE_ID} ${REVISION_ID} ${TEST_KERNEL_nonuniform} ${TEST_KERNEL_nonuniform_options})' \
opencl/test/unit_test/CMakeLists.txt || die
sed -i \
-e 's/level_zero_generate_kernels(l0_test_kernel_outputs \${PLATFORM_IT_LOWER} \${DEVICE_ID} \${REVISION_ID} "-g" \${TEST_MODULES})/level_zero_generate_kernels(l0_test_kernel_outputs ${PLATFORM_IT_LOWER} ${DEVICE_ID} ${REVISION_ID} "-cl-std=CL1.2" ${TEST_MODULES})/' \
-e 's/level_zero_generate_kernels_with_internal_options(l0_bindless_test_kernel_outputs \${PLATFORM_IT_LOWER} "bindless" \${DEVICE_ID} \${REVISION_ID} "-g" \${TEST_KERNEL_BINDLESS_internal_options} \${TEST_KERNEL_BINDLESS})/level_zero_generate_kernels_with_internal_options(l0_bindless_test_kernel_outputs ${PLATFORM_IT_LOWER} "bindless" ${DEVICE_ID} ${REVISION_ID} "-cl-std=CL1.2" ${TEST_KERNEL_BINDLESS_internal_options} ${TEST_KERNEL_BINDLESS})/' \
level_zero/core/test/common/test_modules/CMakeLists.txt || die
sed -i \
-e 's/add_custom_target(run_unit_tests ALL)/add_custom_target(run_unit_tests)/' \
opencl/test/unit_test/CMakeLists.txt \
target_unit_tests/CMakeLists.txt || die
cmake_src_prepare
}
src_configure() {
filter-lto
local mycmakeargs=(
-DCCACHE_ALLOWED="OFF"
-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
-DCMAKE_INSTALL_LIBDIR="$(get_libdir)"
-DBUILD_WITH_L0="$(usex l0)"
-DDISABLE_LIBVA="$(usex !vaapi)"
-DNEO_ALLOW_LEGACY_PLATFORMS_SUPPORT="ON"
-DNEO_DISABLE_LTO="ON"
-DNEO_DISABLE_MITIGATIONS="$(usex disable-mitigations)"
-DNEO_BUILD_UNVERSIONED_OCLOC="ON"
-DNEO__METRICS_LIBRARY_INCLUDE_DIR="${ESYSROOT}/usr/include"
-DKHRONOS_GL_HEADERS_DIR="${ESYSROOT}/usr/include"
-DOCL_ICD_VENDORDIR="${EPREFIX}/etc/OpenCL/vendors"
-DSUPPORT_DG1="ON"
-Wno-dev
-DSKIP_UNIT_TESTS="$(usex !test)"
)
cmake_src_configure
}
src_test() {
addpredict /
cmake_build run_unit_tests
}

View file

@ -62,7 +62,7 @@ src_prepare() {
# Don't hardcode FORTIFY_SOURCE
sed -e '/-D_FORTIFY_SOURCE=2/d' -i IGC/CMakeLists.txt || die
eapply "${FILESDIR}/${P}-llvm22.patch"
eapply "${FILESDIR}/${PN}-2.32.7-llvm22.patch"
perl -0pi -e 's@#include "common/LLVMWarningsPush.hpp"\n@#include "common/LLVMWarningsPush.hpp"\n#include "llvm/Config/llvm-config.h"\n@; s@#define IGC_INITIALIZE_PASS_END\(passName, arg, name, cfg, analysis\).*?^ \}@#if LLVM_VERSION_MAJOR >= 22\n#define IGC_INITIALIZE_PASS_END(passName, arg, name, cfg, analysis) \\\n PassInfo *PI = \\\n new PassInfo(name, arg, &passName ::ID, PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \\\n Registry.registerPass(*PI, true); \\\n } \\\n static llvm::once_flag Initialize##passName##PassFlag; \\\n void initialize##passName##Pass(PassRegistry &Registry) { \\\n llvm::call_once(Initialize##passName##PassFlag, initialize##passName##PassOnce, std::ref(Registry)); \\\n }\n#else\n#define IGC_INITIALIZE_PASS_END(passName, arg, name, cfg, analysis) \\\n PassInfo *PI = \\\n new PassInfo(name, arg, &passName ::ID, PassInfo::NormalCtor_t(callDefaultCtor<passName>), cfg, analysis); \\\n Registry.registerPass(*PI, true); \\\n return PI; \\\n } \\\n static llvm::once_flag Initialize##passName##PassFlag; \\\n void initialize##passName##Pass(PassRegistry &Registry) { \\\n llvm::call_once(Initialize##passName##PassFlag, initialize##passName##PassOnce, std::ref(Registry)); \\\n }\n#endif@ms' IGC/Compiler/IGCPassSupport.h || die

View file

@ -1 +1,2 @@
DIST intel-llvm-6.2.1.tar.gz 293609653 BLAKE2B 10d5410643468e4972e933ce052df02d3319ef9fbffb9e568e9823c0b78e349e3d222a278ad5b093fa1d8bf096d4a14e0f134013f0d61db87b263f2289c889de SHA512 1807501697a748b312dd72b364666ac1016e6603e5c6cd77c62b77f4b3a44dcc37095eec8eadca3401a7674fc84c6c93acb5b6c79deb926a73ea037da5a65093
DIST intel-llvm-6.3.0.tar.gz 293918457 BLAKE2B 8a2563e56c079d44aae5ba8ee15eb2d2f2fb92afc62d322293fb1a706bf99e077d4166fdec732b484d304b13fb62c51a44861515e54b35e3f7a0e15d76611ed8 SHA512 06a51223aa1b2ee47eb70fce7c19af69ba2dbf29fdd8c78ab088616f5f18bfdd57f593c9b5464ec073b271f8b08104949c08420326c8a1916aced3a77fffa865

View file

@ -41,11 +41,11 @@ BDEPEND="virtual/pkgconfig"
#}
src_install() {
insinto "/opt/${PN}/"
for dir in ${S}/* ; do
doins -r $dir
done
fperms +x /opt/intel-llvm/bin/*
dosym /opt/intel-llvm/bin/clang /bin/icx
dosym /opt/intel-llvm/bin/clang++ /bin/icpx
dodir "/opt/${PN}"
cp -a bin include lib "${ED}/opt/${PN}/" || die
dosym /opt/intel-llvm/bin/clang /opt/intel-llvm/bin/icx
dosym /opt/intel-llvm/bin/clang++ /opt/intel-llvm/bin/icpx
dosym ../../opt/intel-llvm/bin/icx /usr/bin/icx
dosym ../../opt/intel-llvm/bin/icpx /usr/bin/icpx
}

View file

@ -0,0 +1,69 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects"
HOMEPAGE="https://github.com/intel/llvm"
SRC_URI="${HOMEPAGE}/releases/download/v${PV}/sycl_linux.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}"
LICENSE="Apache2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
RDEPEND=""
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"
src_test() {
local tdir="${T}/smoke"
mkdir -p "${tdir}" || die
cat > "${tdir}/hello.c" <<-'EOF' || die
#include <stdio.h>
int main(void) {
puts("ok");
return 0;
}
EOF
cat > "${tdir}/hello.cpp" <<-'EOF' || die
#include <array>
int main() {
std::array<int, 2> xs{1, 2};
return xs[0] != 1;
}
EOF
cat > "${tdir}/hello_sycl.cpp" <<-'EOF' || die
#include <sycl/sycl.hpp>
int main() {
sycl::queue q;
(void)q;
return 0;
}
EOF
"${S}/bin/clang" "${tdir}/hello.c" -o "${tdir}/hello-c" || die
"${S}/bin/clang++" -std=c++20 "${tdir}/hello.cpp" -o "${tdir}/hello-cpp" || die
"${S}/bin/clang++" -fsycl -std=c++20 -fsyntax-only "${tdir}/hello_sycl.cpp" || die
}
src_install() {
dodir "/opt/${PN}"
cp -a bin include lib "${ED}/opt/${PN}/" || die
newenvd - 99intel-llvm <<-EOF
LDPATH=/opt/intel-llvm/lib
EOF
dosym /opt/intel-llvm/bin/clang /opt/intel-llvm/bin/icx
dosym /opt/intel-llvm/bin/clang++ /opt/intel-llvm/bin/icpx
dosym ../../opt/intel-llvm/bin/icx /usr/bin/icx
dosym ../../opt/intel-llvm/bin/icpx /usr/bin/icpx
dosym ../../opt/intel-llvm/bin/llvm-foreach /usr/bin/llvm-foreach
}

View file

@ -0,0 +1,16 @@
BDEPEND=|| ( ( dev-lang/python:3.14 dev-python/mako[python_targets_python3_14(-)] ) ( dev-lang/python:3.13 dev-python/mako[python_targets_python3_13(-)] ) ( dev-lang/python:3.12 dev-python/mako[python_targets_python3_12(-)] ) ( dev-lang/python:3.11 dev-python/mako[python_targets_python3_11(-)] ) ) || ( ( dev-lang/python:3.14 dev-python/pyyaml[python_targets_python3_14(-)] ) ( dev-lang/python:3.13 dev-python/pyyaml[python_targets_python3_13(-)] ) ( dev-lang/python:3.12 dev-python/pyyaml[python_targets_python3_12(-)] ) ( dev-lang/python:3.11 dev-python/pyyaml[python_targets_python3_11(-)] ) ) llvm_slot_22? ( llvm-core/lld:22 ) || ( dev-lang/python:3.14 dev-lang/python:3.13 dev-lang/python:3.12 dev-lang/python:3.11 ) app-alternatives/ninja >=dev-build/cmake-3.28.5
DEFINED_PHASES=compile configure install prepare setup test
DEPEND=dev-libs/opencl-clang:22[llvm_slot_22(-)?] dev-util/spirv-tools llvm_slot_22? ( llvm-core/lld:22 llvm-core/llvm:22 ) vc? ( >=dev-libs/intel-vc-intrinsics-0.25.0[llvm_slot_22(-)?] dev-util/spirv-llvm-translator:= )
DESCRIPTION=LLVM-based OpenCL compiler for OpenCL targetting Intel Gen graphics hardware
EAPI=8
HOMEPAGE=https://github.com/intel/intel-graphics-compiler
INHERIT=cmake flag-o-matic llvm-r2 python-any-r1
IUSE=debug vc +llvm_slot_22
KEYWORDS=~amd64
LICENSE=MIT
RDEPEND=!dev-util/intel-graphics-compiler:legacy dev-libs/opencl-clang:22[llvm_slot_22(-)?] dev-util/spirv-tools llvm_slot_22? ( llvm-core/lld:22 llvm-core/llvm:22 ) vc? ( >=dev-libs/intel-vc-intrinsics-0.25.0[llvm_slot_22(-)?] dev-util/spirv-llvm-translator:= )
REQUIRED_USE=^^ ( llvm_slot_22 )
SLOT=0/2.30.1
SRC_URI=https://github.com/intel/intel-graphics-compiler/archive/refs/tags/v2.30.1.tar.gz -> intel-graphics-compiler-2.30.1.tar.gz
_eclasses_=toolchain-funcs 5195689ff6a73b0e789acfa09d4fbcb9 flag-o-matic fd3558f73f6503093adee69adf41020d multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 ninja-utils d063ea1900a793f93eb095010d6d9156 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 cmake 3395ce6618fc5c7af03335471b896644 llvm-utils e7edb4086e31c8537574b263d899f826 multilib fc812e8eb2170022c28272d80a1f9e77 llvm-r2 8bc46809768366b4239eab39335419bc eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd python-utils-r1 9c4180f103a0e8340bc993fc85dbdadd python-any-r1 891415dfe39ad9b41b461f2b86354af0
_md5_=e67a9bca030e601e05c83858a6a18407

View file

@ -13,4 +13,4 @@ REQUIRED_USE=^^ ( llvm_slot_22 )
SLOT=0/2.32.7
SRC_URI=https://github.com/intel/intel-graphics-compiler/archive/refs/tags/v2.32.7.tar.gz -> intel-graphics-compiler-2.32.7.tar.gz
_eclasses_=toolchain-funcs 5195689ff6a73b0e789acfa09d4fbcb9 flag-o-matic fd3558f73f6503093adee69adf41020d multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 ninja-utils d063ea1900a793f93eb095010d6d9156 xdg-utils 42869b3c8d86a70ef3cf75165a395e09 cmake 3395ce6618fc5c7af03335471b896644 llvm-utils e7edb4086e31c8537574b263d899f826 multilib fc812e8eb2170022c28272d80a1f9e77 llvm-r2 8bc46809768366b4239eab39335419bc eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd python-utils-r1 9c4180f103a0e8340bc993fc85dbdadd python-any-r1 891415dfe39ad9b41b461f2b86354af0
_md5_=9781c89e547ad7650ab97d7ef6ade55d
_md5_=e67a9bca030e601e05c83858a6a18407

View file

@ -0,0 +1,16 @@
BDEPEND=test? ( >=sci-ml/huggingface_hub-1.3.0[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] <sci-ml/huggingface_hub-2 =sci-ml/tokenizers-0.22*[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] python_single_target_python3_11? ( dev-python/filelock[python_targets_python3_11(-)] dev-python/numpy[python_targets_python3_11(-)] dev-python/packaging[python_targets_python3_11(-)] dev-python/pyyaml[python_targets_python3_11(-)] dev-python/regex[python_targets_python3_11(-)] dev-python/tqdm[python_targets_python3_11(-)] dev-python/typer[python_targets_python3_11(-)] sci-ml/safetensors[python_targets_python3_11(-)] ) python_single_target_python3_12? ( dev-python/filelock[python_targets_python3_12(-)] dev-python/numpy[python_targets_python3_12(-)] dev-python/packaging[python_targets_python3_12(-)] dev-python/pyyaml[python_targets_python3_12(-)] dev-python/regex[python_targets_python3_12(-)] dev-python/tqdm[python_targets_python3_12(-)] dev-python/typer[python_targets_python3_12(-)] sci-ml/safetensors[python_targets_python3_12(-)] ) python_single_target_python3_13? ( dev-python/filelock[python_targets_python3_13(-)] dev-python/numpy[python_targets_python3_13(-)] dev-python/packaging[python_targets_python3_13(-)] dev-python/pyyaml[python_targets_python3_13(-)] dev-python/regex[python_targets_python3_13(-)] dev-python/tqdm[python_targets_python3_13(-)] dev-python/typer[python_targets_python3_13(-)] sci-ml/safetensors[python_targets_python3_13(-)] ) python_single_target_python3_14? ( dev-python/filelock[python_targets_python3_14(-)] dev-python/numpy[python_targets_python3_14(-)] dev-python/packaging[python_targets_python3_14(-)] dev-python/pyyaml[python_targets_python3_14(-)] dev-python/regex[python_targets_python3_14(-)] dev-python/tqdm[python_targets_python3_14(-)] dev-python/typer[python_targets_python3_14(-)] sci-ml/safetensors[python_targets_python3_14(-)] ) torch? ( sci-ml/accelerate[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] sci-ml/caffe2[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] sci-ml/pytorch[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] ) test? ( sci-ml/datasets[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] sci-ml/caffe2[distributed] ) python_single_target_python3_11? ( >=dev-python/pytest-7.4.4[python_targets_python3_11(-)] ) python_single_target_python3_12? ( >=dev-python/pytest-7.4.4[python_targets_python3_12(-)] ) python_single_target_python3_13? ( >=dev-python/pytest-7.4.4[python_targets_python3_13(-)] ) python_single_target_python3_14? ( >=dev-python/pytest-7.4.4[python_targets_python3_14(-)] ) ) python_single_target_python3_11? ( dev-lang/python:3.11 ) python_single_target_python3_12? ( dev-lang/python:3.12 ) python_single_target_python3_13? ( dev-lang/python:3.13 ) python_single_target_python3_14? ( dev-lang/python:3.14 ) python_single_target_python3_11? ( >=dev-python/gpep517-16[python_targets_python3_11(-)] >=dev-python/setuptools-78.1.0[python_targets_python3_11(-)] ) python_single_target_python3_12? ( >=dev-python/gpep517-16[python_targets_python3_12(-)] >=dev-python/setuptools-78.1.0[python_targets_python3_12(-)] ) python_single_target_python3_13? ( >=dev-python/gpep517-16[python_targets_python3_13(-)] >=dev-python/setuptools-78.1.0[python_targets_python3_13(-)] ) python_single_target_python3_14? ( >=dev-python/gpep517-16[python_targets_python3_14(-)] >=dev-python/setuptools-78.1.0[python_targets_python3_14(-)] )
DEFINED_PHASES=compile configure install prepare setup test
DESCRIPTION=State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow
EAPI=8
HOMEPAGE=https://pypi.org/project/transformers/ https://huggingface.co/
INHERIT=distutils-r1
IUSE=test torch test python_single_target_python3_11 python_single_target_python3_12 python_single_target_python3_13 python_single_target_python3_14
KEYWORDS=~amd64
LICENSE=Apache-2.0
RDEPEND=>=sci-ml/huggingface_hub-1.3.0[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] <sci-ml/huggingface_hub-2 =sci-ml/tokenizers-0.22*[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] python_single_target_python3_11? ( dev-python/filelock[python_targets_python3_11(-)] dev-python/numpy[python_targets_python3_11(-)] dev-python/packaging[python_targets_python3_11(-)] dev-python/pyyaml[python_targets_python3_11(-)] dev-python/regex[python_targets_python3_11(-)] dev-python/tqdm[python_targets_python3_11(-)] dev-python/typer[python_targets_python3_11(-)] sci-ml/safetensors[python_targets_python3_11(-)] ) python_single_target_python3_12? ( dev-python/filelock[python_targets_python3_12(-)] dev-python/numpy[python_targets_python3_12(-)] dev-python/packaging[python_targets_python3_12(-)] dev-python/pyyaml[python_targets_python3_12(-)] dev-python/regex[python_targets_python3_12(-)] dev-python/tqdm[python_targets_python3_12(-)] dev-python/typer[python_targets_python3_12(-)] sci-ml/safetensors[python_targets_python3_12(-)] ) python_single_target_python3_13? ( dev-python/filelock[python_targets_python3_13(-)] dev-python/numpy[python_targets_python3_13(-)] dev-python/packaging[python_targets_python3_13(-)] dev-python/pyyaml[python_targets_python3_13(-)] dev-python/regex[python_targets_python3_13(-)] dev-python/tqdm[python_targets_python3_13(-)] dev-python/typer[python_targets_python3_13(-)] sci-ml/safetensors[python_targets_python3_13(-)] ) python_single_target_python3_14? ( dev-python/filelock[python_targets_python3_14(-)] dev-python/numpy[python_targets_python3_14(-)] dev-python/packaging[python_targets_python3_14(-)] dev-python/pyyaml[python_targets_python3_14(-)] dev-python/regex[python_targets_python3_14(-)] dev-python/tqdm[python_targets_python3_14(-)] dev-python/typer[python_targets_python3_14(-)] sci-ml/safetensors[python_targets_python3_14(-)] ) torch? ( sci-ml/accelerate[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] sci-ml/caffe2[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] sci-ml/pytorch[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] ) test? ( sci-ml/datasets[python_single_target_python3_11(-)?,python_single_target_python3_12(-)?,python_single_target_python3_13(-)?,python_single_target_python3_14(-)?] sci-ml/caffe2[distributed] ) python_single_target_python3_11? ( dev-lang/python:3.11 ) python_single_target_python3_12? ( dev-lang/python:3.12 ) python_single_target_python3_13? ( dev-lang/python:3.13 ) python_single_target_python3_14? ( dev-lang/python:3.14 )
REQUIRED_USE=^^ ( python_single_target_python3_11 python_single_target_python3_12 python_single_target_python3_13 python_single_target_python3_14 )
RESTRICT=!test? ( test )
SLOT=0
SRC_URI=https://github.com/huggingface/transformers/archive/refs/tags/v5.5.4.tar.gz -> transformers-5.5.4.gh.tar.gz
_eclasses_=eapi9-pipestatus d2c134036ac31c3085aebc9147f572bd toolchain-funcs 5195689ff6a73b0e789acfa09d4fbcb9 flag-o-matic fd3558f73f6503093adee69adf41020d out-of-source-utils 8e5093bd27b7f541a1913271f25d633a multibuild 83db098a835f71feb71761f72a694aa2 multilib fc812e8eb2170022c28272d80a1f9e77 multiprocessing 45d0620f25c2f063ad6276ecd9ed9399 ninja-utils d063ea1900a793f93eb095010d6d9156 python-utils-r1 9c4180f103a0e8340bc993fc85dbdadd python-single-r1 47d8ac9be330c9366112b78fd4f8ce57 distutils-r1 62add15ed646bfe511af53e282621b39
_md5_=e7d015d629319bd9e90f245db64c4a5d

3
sci-ml/caffe2/Manifest Normal file
View file

@ -0,0 +1,3 @@
DIST composable_kernel-7fe50dc3.tar.gz 5380728 BLAKE2B c89c346d8e2d7a93a9cf26409e477fcdd25c43bc3f99d904c3bfe1bc282c6844ef2f2c80aceabe3bf4494db3457285384d5de5a22281aa426ba7479af82b0caf SHA512 a62f92e2dd7da944bd34bab6cf3bf624f630dc316d29c755e9fd523343c3f7648b0b7e0c9a0c8f5e9654477599ae8be9dac687d4054b0390f064ac2e40fc1cd3
DIST flash-attention-2.7.4.gh.tar.gz 5841323 BLAKE2B 432999d763f2b3d732580ddfea5d3e01370351db0656546259a5e500a07516dd03c98828bfb55855dabe4adc651033b5d97ea4725ca46158b9970f0fbc662710 SHA512 05a4afb09e666f7404d6a3f8b5256e7bed6eba60a6f1bde2b7dbb96d318975f0b458c2521c7a38d88e97b6e4c27f29077cf787849daf82586e33f43a3d9a84b3
DIST pytorch-2.11.0.tar.gz 63504636 BLAKE2B d7227bd2d5475acf696bb48a3ca8cd8b7b6cd75fb99e64ebc71434e23817f94dea5164f48a176dcad1acd12186c33b02452582c1b41d6265b89cf54b29630670 SHA512 a5b27efdbce0506b49808e9dc5fbf1a56a22b1651b60236570823e1fe2c7395a0de9d3d7a01a568a201d593c52e7aa402e5d7645a54cb5932d5866e374ebf945

View file

@ -44,19 +44,20 @@ S="${WORKDIR}"/${MYP}
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
IUSE="cuda cusparselt distributed fbgemm flash gloo kineto memefficient
mimalloc mkl mpi nccl nnpack +numpy onednn openblas opencl openmp qnnpack
rocm xnnpack"
IUSE="cuda cusparselt distributed fbgemm flash gloo intel_targets_gfx-bmg kineto
memefficient mimalloc mkl mpi nccl nnpack +numpy onednn openblas opencl
openmp qnnpack rocm xnnpack xpu"
RESTRICT="test"
REQUIRED_USE="
${PYTHON_REQUIRED_USE}
mpi? ( distributed )
gloo? ( distributed )
?? ( cuda rocm )
?? ( cuda rocm xpu )
rocm? (
|| ( ${ROCM_REQUIRED_USE} )
memefficient? ( flash )
)
xpu? ( amd64 )
cusparselt? ( || ( cuda rocm ) )
flash? ( || ( cuda rocm ) )
memefficient? ( || ( cuda rocm ) )
@ -127,6 +128,13 @@ RDEPEND="
)
mkl? ( sci-libs/mkl )
openblas? ( sci-libs/openblas )
xpu? (
>=dev-libs/intel-compute-runtime-26.14.37833.4[l0]
>=dev-util/intel-llvm-6.3.0
sci-ml/oneDNN[sycl]
~sci-ml/torch-xpu-ops-2.12.0_p20260414
virtual/opencl
)
"
DEPEND="
@ -175,6 +183,71 @@ src_prepare() {
if use cuda && ( use flash || use memefficient ); then
mv "${WORKDIR}"/${FLASH_P}/* third_party/${FLASH_PN}/ || die
fi
if use xpu; then
rm -rf third_party/torch-xpu-ops || die
mkdir -p third_party/torch-xpu-ops || die
cp -a "${ESYSROOT}/usr/share/torch-xpu-ops/current/." third_party/torch-xpu-ops/ || die
sed -i \
-e 's/SYCL_CMPLR_TEST_EXTRACT(${test_output}/SYCL_CMPLR_TEST_EXTRACT("${test_output}"/g' \
-e 's/CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"/CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "MSVC"/' \
-e 's/CMAKE_CXX_COMPILER_ID STREQUAL "GNU"/CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang"/g' \
-e '/gline-tables-only/d' \
third_party/torch-xpu-ops/cmake/Modules/FindSYCLToolkit.cmake \
third_party/torch-xpu-ops/cmake/BuildFlags.cmake \
third_party/torch-xpu-ops/CMakeLists.txt || die
sed -i \
-e '44i\ target_include_directories(${sycl_lib} PRIVATE ${TORCH_XPU_OPS_INCLUDE_DIRS})\n target_include_directories(${sycl_lib} PRIVATE ${TORCH_XPU_OPS_ROOT}/src)\n target_include_directories(${sycl_lib} PRIVATE ${ATen_XPU_INCLUDE_DIRS})\n target_include_directories(${sycl_lib} PRIVATE ${SYCL_INCLUDE_DIR})' \
-e '/target_include_directories(${lib} PUBLIC ${TORCH_XPU_OPS_INCLUDE_DIRS})/a\ target_include_directories(${lib} PUBLIC ${TORCH_XPU_OPS_ROOT}/src)' \
-e '/target_link_libraries(${lib} PUBLIC ${SYCL_LIBRARY})/a\ target_link_libraries(${lib} PUBLIC c10_xpu)\n target_link_libraries(${lib} PUBLIC torch_cpu)\n target_link_libraries(${lib} PUBLIC c10)' \
third_party/torch-xpu-ops/src/BuildOnLinux.cmake || die
sed -i \
-e '/SYCL_OFFLINE_COMPILER_CG_OPTIONS .*cl-poison-unsupported-fp64-kernels/d' \
-e '/SYCL_OFFLINE_COMPILER_CG_OPTIONS .*cl-intel-enable-auto-large-GRF-mode/d' \
-e '/SYCL_OFFLINE_COMPILER_CG_OPTIONS .*cl-fp32-correctly-rounded-divide-sqrt/d' \
-e '/SYCL_OFFLINE_COMPILER_CG_OPTIONS .*cl-intel-greater-than-4GB-buffer-required/d' \
third_party/torch-xpu-ops/cmake/BuildFlags.cmake || die
perl -0pi -e 's@return WelfordDataLN\{\n sycl::select_from_group\(sg, wd.mean, 0\),\n sycl::select_from_group\(sg, wd.sigma2, 0\) \/ float\(N\),\n 0\.f\};@if (sg.get_local_linear_id() == 0) {\n buf[0] = wd.mean;\n buf[1] = wd.sigma2 / float(N);\n }\n sycl::group_barrier(item_id.get_group());\n return WelfordDataLN{\n static_cast<float>(buf[0]), static_cast<float>(buf[1]), 0.f};@' \
third_party/torch-xpu-ops/src/ATen/native/xpu/sycl/LayerNormKernels.cpp || die
perl -0pi -e 's@if \(sub_group_num == 1\) \{\n sum1 = sycl::group_broadcast\(sg, sum1, 0\);\n sum2 = sycl::group_broadcast\(sg, sum2, 0\);\n return;\n \}@if (sub_group_num == 1) {\n if (sg.get_local_linear_id() == 0) {\n local_data1[0] = sum1;\n local_data2[0] = sum2;\n }\n sycl::group_barrier(item.get_group());\n sum1 = local_data1[0];\n sum2 = local_data2[0];\n return;\n }@' \
third_party/torch-xpu-ops/src/ATen/native/xpu/sycl/Norm.h || die
perl -0pi -e 's@if \(sub_group_num == 1\) \{\n val = sycl::group_broadcast\(sg, val, 0\);\n return;\n \}@if (sub_group_num == 1) {\n if (sg.get_local_linear_id() == 0) {\n local_data[lid_row][0] = val;\n }\n sycl::group_barrier(item.get_group());\n val = local_data[lid_row][0];\n return;\n }@' \
third_party/torch-xpu-ops/src/ATen/native/xpu/sycl/SoftMaxKernels.cpp || die
perl -0pi -e 's@auto\* device_prop = at::xpu::getCurrentDeviceProperties\(\);\n auto device_architecture = device_prop->architecture;@auto& device = c10::xpu::get_raw_device(at::xpu::current_device());\n auto device_architecture = device.get_info<sycl::ext::oneapi::experimental::info::device::architecture>();@' \
aten/src/ATen/native/transformers/xpu/sdp_utils.cpp || die
perl -0pi -e 's@list\(APPEND ATen_XPU_DEPENDENCY_LIBS xpu_mkldnn\)@list(APPEND ATen_XPU_DEPENDENCY_LIBS ${XPU_MKLDNN_LIBRARIES})@' \
aten/src/ATen/CMakeLists.txt || die
# XPU increases generated TraceType size enough that some shards become
# pathological compile units on Clang; split them further.
perl -0pi -e 's@num_shards=5,@num_shards=10,@' \
tools/autograd/gen_trace_type.py || die
sed -i \
-e 's@set(SYCL_EXECUTABLE \${SYCL_COMPILER} CACHE FILEPATH "SYCL compiler")@set(SYCL_EXECUTABLE "icpx" CACHE FILEPATH "SYCL compiler")@' \
-e '67,68c\set(SYCL_HOST_COMPILER "clang++"\n CACHE FILEPATH "Host side compiler used by SYCL")' \
-e '/set(_sycl_c_or_cxx_flags ${CMAKE_${SYCL_C_OR_CXX}_FLAGS})/c\
set(_sycl_c_or_cxx_flags ${CMAKE_${SYCL_C_OR_CXX}_FLAGS})\
string(APPEND _sycl_c_or_cxx_flags " -stdlib=libstdc++")\
string(REPLACE "-fma" "-mfma" _sycl_c_or_cxx_flags "${_sycl_c_or_cxx_flags}")\
string(REPLACE "-no-ftz" "" _sycl_c_or_cxx_flags "${_sycl_c_or_cxx_flags}")' \
-e '405,409c\ COMMAND ${CMAKE_SYCL_COMPILER_LAUNCHER} ${SYCL_EXECUTABLE}\n -fsycl ${SYCL_device_link_flags}\n -fsycl-link ${object_files}\n -Xs ${SYCL_OFFLINE_COMPILER_FLAGS}\n -o ${output_file}' \
third_party/torch-xpu-ops/cmake/Modules/FindSYCL.cmake || die
perl -0pi -e 's@list\(APPEND SYCL_include_dirs "\$<TARGET_PROPERTY:\$\{sycl_target\},INCLUDE_DIRECTORIES>"\)@list(APPEND SYCL_include_dirs "${TORCH_XPU_OPS_ROOT}/src")\n list(APPEND SYCL_include_dirs "\$<TARGET_PROPERTY:\${sycl_target},INCLUDE_DIRECTORIES>")@' \
third_party/torch-xpu-ops/cmake/Modules/FindSYCL.cmake || die
sed -i \
-e '37c\set(SYCL_executable "icpx") # path' \
-e '38i\set(SYCL_launcher "@CMAKE_SYCL_COMPILER_LAUNCHER@") # path' \
-e '39i\list(REMOVE_ITEM SYCL_compile_flags -fma -no-ftz -gline-tables-only)\nlist(INSERT SYCL_compile_flags 0 -fsycl -mfma -stdlib=libstdc++)' \
-e '43i\string(REGEX REPLACE "/ATen/.*" "" TORCH_XPU_OPS_SRC_ROOT "${source_file}")\nlist(APPEND SYCL_include_dirs "${TORCH_XPU_OPS_SRC_ROOT}")' \
-e '66i\list(REMOVE_ITEM CMAKE_HOST_FLAGS -fma -no-ftz)\nlist(APPEND CMAKE_HOST_FLAGS -mfma -stdlib=libstdc++)' \
third_party/torch-xpu-ops/cmake/Modules/FindSYCL/run_sycl.cmake || die
perl -0pi -e 's@SYCL_execute_process\(\n "Generating \$\{generated_file\}"\n COMMAND "\$\{SYCL_executable\}"\n \$\{SYCL_dependency_file_args\}\n -c\n "\$\{source_file\}"\n -o "\$\{generated_file\}"\n \$\{SYCL_include_args\}\n \$\{SYCL_host_compiler\}\n \$\{SYCL_host_compiler_flags\}\n \$\{SYCL_compile_flags\}\n \)@SYCL_execute_process(\n "Generating \$\{generated_file\}"\n COMMAND \$\{SYCL_launcher\} "\$\{SYCL_executable\}"\n \$\{SYCL_dependency_file_args\}\n -c\n "\$\{source_file\}"\n -o "\$\{generated_file\}"\n \$\{SYCL_include_args\}\n \$\{SYCL_host_compiler\}\n \$\{SYCL_host_compiler_flags\}\n \$\{SYCL_compile_flags\}\n )@s' \
third_party/torch-xpu-ops/cmake/Modules/FindSYCL/run_sycl.cmake || die
sed -i \
-e '10i\if(SYCL_FOUND)\n set(SYCLTOOLKIT_FOUND TRUE)\nendif()' \
third_party/torch-xpu-ops/cmake/SYCL.cmake || die
sed -i \
-e '93,96c\if(TORCH_XPU_OPS_PYTORCH_DEPS AND COMMAND sycl_include_external_dependencies)\n sycl_include_external_dependencies(${TORCH_XPU_OPS_PYTORCH_DEPS})\nendif()' \
third_party/torch-xpu-ops/CMakeLists.txt || die
fi
filter-lto #bug 862672
# Unbundle fmt
@ -214,6 +287,23 @@ src_prepare() {
# Noisy warnings from Logging.h
sed -i 's/-Wextra-semi//' cmake/public/utils.cmake || die
# Gentoo provides torch-xpu-ops from installed source payload, so do not clone/fetch.
sed -i -e '1156,1179c\ # Gentoo: torch-xpu-ops vendored in distfiles.' \
caffe2/CMakeLists.txt || die
sed -i -e '1157d' caffe2/CMakeLists.txt || die
# Upstream XPU finder hardcodes OpenCL lookup to SYCL_ROOT/lib.
# Gentoo ships libOpenCL in system libdirs, so use default search there.
perl -0pi -e 's@find_library\(\n OCL_LIBRARY\n NAMES OpenCL\n HINTS \$\{SYCL_LIBRARY_DIR\}\n NO_DEFAULT_PATH\n\)@find_library(\n OCL_LIBRARY\n NAMES OpenCL\n)@' \
cmake/Modules/FindSYCLToolkit.cmake || die
# intel-llvm 6.3.0 reports `Intel SYCL compiler 6.3.0 ...`, while upstream
# only matches the older `Intel(R) ... Compiler ...` form.
sed -i \
-e '47c\ string(REGEX MATCH "([0-9]+\\.[0-9]+\\.[0-9]+)" SYCL_VERSION_STRING_MATCH "${SYCL_VERSION_STRING}")' \
-e '48c\ set(SYCL_VERSION_STRING_MATCH "${CMAKE_MATCH_1}")' \
cmake/Modules/FindSYCLToolkit.cmake || die
cmake_src_prepare
pushd torch/csrc/jit/serialization > /dev/null || die
flatc --cpp --gen-mutable --scoped-enums mobile_bytecode.fbs || die
@ -265,6 +355,12 @@ src_prepare() {
}
src_configure() {
if use xpu; then
# Intel's libsycl in intel-llvm 6.3.0 exposes libstdc++ mangled symbols.
# Keep the whole C++ build on the same stdlib ABI to avoid runtime loader failures.
append-cxxflags -stdlib=libstdc++
fi
if use cuda && [[ -z ${TORCH_CUDA_ARCH_LIST} ]]; then
ewarn "WARNING: caffe2 is being built with its default CUDA compute capabilities: 3.5 and 7.0."
ewarn "These may not be optimal for your GPU."
@ -325,7 +421,8 @@ src_configure() {
-DUSE_UCC=OFF
-DUSE_VALGRIND=OFF
-DUSE_XNNPACK=$(usex xnnpack)
-DUSE_XPU=OFF
-DUSE_XCCL=OFF
-DUSE_XPU=$(usex xpu)
-Wno-dev
)
@ -374,6 +471,33 @@ src_configure() {
# ROCm libraries produce too much warnings
append-cxxflags -Wno-deprecated-declarations -Wno-unused-result -Wno-unused-value
elif use xpu; then
local _host_clangxx=$(type -ap clang++ | grep -v '^/usr/lib/ccache/bin/clang++$' | head -n1)
local _host_clang_dir=${_host_clangxx%/*}
export SYCL_ROOT="${ESYSROOT}/opt/intel-llvm"
export CCACHE_PATH="${_host_clang_dir}:/usr/bin:${SYCL_ROOT}/bin"
export PATH="/usr/lib/ccache/bin:${_host_clang_dir}:/usr/bin:${SYCL_ROOT}/bin${PATH:+:${PATH}}"
export LD_LIBRARY_PATH="${SYCL_ROOT}/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
export LIBRARY_PATH="${SYCL_ROOT}/lib${LIBRARY_PATH:+:${LIBRARY_PATH}}"
# TODO: try enabling again after XPU ebuild compiles reliably.
export USE_ONEMKL_XPU=OFF
if use intel_targets_gfx-bmg; then
export TORCH_XPU_ARCH_LIST=bmg
else
export TORCH_XPU_ARCH_LIST=none
fi
[[ -n ${TORCH_XPU_ARCH_LIST} ]] && mycmakeargs+=(
-DTORCH_XPU_ARCH_LIST="${TORCH_XPU_ARCH_LIST}"
)
if has ccache ${FEATURES}; then
mycmakeargs+=(
-DCMAKE_SYCL_COMPILER_LAUNCHER=ccache
)
fi
fi
if use onednn; then
@ -409,6 +533,12 @@ python_install() {
src_install() {
cmake_src_install
if [[ -e ${ED}/usr/lib/libc10_xpu.so ]]; then
mkdir -p "${ED}/usr/$(get_libdir)" || die
mv "${ED}/usr/lib/libc10_xpu.so" "${ED}/usr/$(get_libdir)/libc10_xpu.so" || die
rmdir --ignore-fail-on-non-empty "${ED}/usr/lib" || die
fi
# Used by pytorch ebuild
insinto "/var/lib/${PN}"
doins "${BUILD_DIR}"/CMakeCache.txt

1
sci-ml/pytorch/Manifest Normal file
View file

@ -0,0 +1 @@
DIST pytorch-2.11.0.tar.gz 63504636 BLAKE2B d7227bd2d5475acf696bb48a3ca8cd8b7b6cd75fb99e64ebc71434e23817f94dea5164f48a176dcad1acd12186c33b02452582c1b41d6265b89cf54b29630670 SHA512 a5b27efdbce0506b49808e9dc5fbf1a56a22b1651b60236570823e1fe2c7395a0de9d3d7a01a568a201d593c52e7aa402e5d7645a54cb5932d5866e374ebf945

View file

@ -18,11 +18,12 @@ LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm64"
RESTRICT="test"
IUSE="xpu"
REQUIRED_USE=${PYTHON_REQUIRED_USE}
RDEPEND="
${PYTHON_DEPS}
~sci-ml/caffe2-${PV}[${PYTHON_SINGLE_USEDEP}]
~sci-ml/caffe2-${PV}[${PYTHON_SINGLE_USEDEP},xpu?]
$(python_gen_cond_dep '
dev-python/sympy[${PYTHON_USEDEP}]
dev-python/typing-extensions[${PYTHON_USEDEP}]

View file

@ -0,0 +1 @@
DIST torch-xpu-ops-2.12.0_p20260414.gh.tar.gz 1794199 BLAKE2B 2be6f1394ce493e915e3bd249f7b998fa28236e7ef7e7fbccc4c9b40b3cb29ec71c651358cfb88a0510844ce9ba434612b5fe892d8bb6ff9bb89e67e8c5e56d9 SHA512 e871f31789874ae1b883cf0c3b200e92ef356c8be2d2738bdf580a9c3419396c2f2223a5554e750d27138341d7d09d59d0eb0de7d123cda6c60e0016e2dad1b3

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>tupone@gentoo.org</email>
<name>Tupone Alfredo</name>
</maintainer>
<upstream>
<bugs-to>https://github.com/intel/torch-xpu-ops/issues</bugs-to>
<remote-id type="github">intel/torch-xpu-ops</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,26 @@
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DESCRIPTION="Intel XPU ATen operators for PyTorch"
HOMEPAGE="https://github.com/intel/torch-xpu-ops"
COMMIT="5aa1a01d53822166ff64db98d566bb871e419cc6"
SRC_URI="https://github.com/intel/torch-xpu-ops/archive/${COMMIT}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/${PN}-${COMMIT}"
LICENSE="Apache-2.0 BSD"
SLOT="0"
KEYWORDS="~amd64"
src_prepare() {
default
}
src_install() {
local dest="/usr/share/${PN}/${PV}"
dodir "${dest}"
cp -a . "${ED}${dest}/" || die
dosym "${PV}" "/usr/share/${PN}/current"
}

View file

@ -0,0 +1 @@
DIST transformers-5.5.4.gh.tar.gz 17487417 BLAKE2B ba1f3deaf5efddd89cf58fc572bb4f53bcfc9cdb75066a44e2d4a7f367f42cf75fd54e9ecf0fb3f46e0381308aba7757589f4bc1c51624bbc882e2362fe25f49 SHA512 473decce0310181f58def4ff239539452d56c87356f4504d8f3c69b9888fe28cfd95786131e5d1d43a311fa7f529b3946e38cf9af922a206d1dba38e5e812b73

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>haskell@gentoo.org</email>
</maintainer>
</pkgmetadata>

View file

@ -0,0 +1,57 @@
# Copyright 2023-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..14} )
DISTUTILS_SINGLE_IMPL=1
inherit distutils-r1
DESCRIPTION="State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow"
HOMEPAGE="
https://pypi.org/project/transformers/
https://huggingface.co/
"
SRC_URI="https://github.com/huggingface/${PN}/archive/refs/tags/v${PV}.tar.gz
-> ${P}.gh.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test torch"
RDEPEND="
>=sci-ml/huggingface_hub-1.3.0[${PYTHON_SINGLE_USEDEP}]
<sci-ml/huggingface_hub-2
=sci-ml/tokenizers-0.22*[${PYTHON_SINGLE_USEDEP}]
$(python_gen_cond_dep '
dev-python/filelock[${PYTHON_USEDEP}]
dev-python/numpy[${PYTHON_USEDEP}]
dev-python/packaging[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/regex[${PYTHON_USEDEP}]
dev-python/tqdm[${PYTHON_USEDEP}]
dev-python/typer[${PYTHON_USEDEP}]
sci-ml/safetensors[${PYTHON_USEDEP}]
')
torch? (
sci-ml/accelerate[${PYTHON_SINGLE_USEDEP}]
sci-ml/caffe2[${PYTHON_SINGLE_USEDEP}]
sci-ml/pytorch[${PYTHON_SINGLE_USEDEP}]
)
test? (
sci-ml/datasets[${PYTHON_SINGLE_USEDEP}]
sci-ml/caffe2[distributed]
)
"
EPYTEST_PLUGINS=()
distutils_enable_tests pytest
python_test() {
epytest tests/models/bert \
tests/models/gpt2 \
tests/models/roberta \
tests/models/distilbert
}