ci update
Some checks failed
build_docker / build_cpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_cpu (linux/amd64) (pull_request) Has been cancelled
build_docker / essential (push) Successful in 0s
build_docker / build_gpu (linux/amd64) (push) Has been cancelled
build_docker / build_gpu (linux/arm64) (push) Has been cancelled
build_docker / build_cpu (linux/amd64) (push) Has been cancelled
build_docker / build_cpu (linux/arm64) (push) Has been cancelled
build_docker / essential (pull_request) Successful in 1s
Some checks failed
build_docker / build_cpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_cpu (linux/amd64) (pull_request) Has been cancelled
build_docker / essential (push) Successful in 0s
build_docker / build_gpu (linux/amd64) (push) Has been cancelled
build_docker / build_gpu (linux/arm64) (push) Has been cancelled
build_docker / build_cpu (linux/amd64) (push) Has been cancelled
build_docker / build_cpu (linux/arm64) (push) Has been cancelled
build_docker / essential (pull_request) Successful in 1s
This commit is contained in:
@@ -91,6 +91,43 @@ RUN sed -i 's/-m64//g' cmake/flags.cmake && \
|
||||
find . -name "*.cmake" -exec sed -i 's/-m64//g' {} \; 2>/dev/null || true && \
|
||||
echo "Patched -m64 flag for ARM64 compatibility"
|
||||
|
||||
# Patch for ARM64: Install sse2neon to translate x86 SSE intrinsics to ARM NEON
|
||||
# sse2neon provides drop-in replacements for x86 SIMD headers
|
||||
RUN git clone --depth 1 https://github.com/DLTcollab/sse2neon.git /tmp/sse2neon && \
|
||||
mkdir -p /usr/local/include/sse2neon && \
|
||||
cp /tmp/sse2neon/sse2neon.h /usr/local/include/sse2neon/ && \
|
||||
rm -rf /tmp/sse2neon && \
|
||||
echo "Installed sse2neon for x86->ARM NEON translation"
|
||||
|
||||
# Create wrapper headers that use sse2neon for ARM64
|
||||
RUN mkdir -p /usr/local/include/x86_stubs && \
|
||||
echo "#ifndef __x86_64__" > /usr/local/include/x86_stubs/immintrin.h && \
|
||||
echo "#include <sse2neon/sse2neon.h>" >> /usr/local/include/x86_stubs/immintrin.h && \
|
||||
echo "#else" >> /usr/local/include/x86_stubs/immintrin.h && \
|
||||
echo "#include_next <immintrin.h>" >> /usr/local/include/x86_stubs/immintrin.h && \
|
||||
echo "#endif" >> /usr/local/include/x86_stubs/immintrin.h && \
|
||||
echo "#ifndef __x86_64__" > /usr/local/include/x86_stubs/xmmintrin.h && \
|
||||
echo "#include <sse2neon/sse2neon.h>" >> /usr/local/include/x86_stubs/xmmintrin.h && \
|
||||
echo "#else" >> /usr/local/include/x86_stubs/xmmintrin.h && \
|
||||
echo "#include_next <xmmintrin.h>" >> /usr/local/include/x86_stubs/xmmintrin.h && \
|
||||
echo "#endif" >> /usr/local/include/x86_stubs/xmmintrin.h && \
|
||||
echo "#ifndef __x86_64__" > /usr/local/include/x86_stubs/emmintrin.h && \
|
||||
echo "#include <sse2neon/sse2neon.h>" >> /usr/local/include/x86_stubs/emmintrin.h && \
|
||||
echo "#else" >> /usr/local/include/x86_stubs/emmintrin.h && \
|
||||
echo "#include_next <emmintrin.h>" >> /usr/local/include/x86_stubs/emmintrin.h && \
|
||||
echo "#endif" >> /usr/local/include/x86_stubs/emmintrin.h && \
|
||||
echo "#ifndef __x86_64__" > /usr/local/include/x86_stubs/pmmintrin.h && \
|
||||
echo "#include <sse2neon/sse2neon.h>" >> /usr/local/include/x86_stubs/pmmintrin.h && \
|
||||
echo "#else" >> /usr/local/include/x86_stubs/pmmintrin.h && \
|
||||
echo "#include_next <pmmintrin.h>" >> /usr/local/include/x86_stubs/pmmintrin.h && \
|
||||
echo "#endif" >> /usr/local/include/x86_stubs/pmmintrin.h && \
|
||||
echo "#ifndef __x86_64__" > /usr/local/include/x86_stubs/smmintrin.h && \
|
||||
echo "#include <sse2neon/sse2neon.h>" >> /usr/local/include/x86_stubs/smmintrin.h && \
|
||||
echo "#else" >> /usr/local/include/x86_stubs/smmintrin.h && \
|
||||
echo "#include_next <smmintrin.h>" >> /usr/local/include/x86_stubs/smmintrin.h && \
|
||||
echo "#endif" >> /usr/local/include/x86_stubs/smmintrin.h && \
|
||||
echo "Created x86 intrinsic wrapper headers for ARM64 using sse2neon"
|
||||
|
||||
# Install additional Python requirements for building
|
||||
RUN pip install -r python/requirements.txt || true
|
||||
|
||||
@@ -99,6 +136,7 @@ RUN mkdir -p build
|
||||
WORKDIR /build/Paddle/build
|
||||
|
||||
# Configure CMake for ARM64 + CUDA build
|
||||
# Note: -Wno-class-memaccess fixes Eigen NEON warning on ARM64
|
||||
RUN echo "Building for CUDA architecture: sm_${CUDA_ARCH}" && \
|
||||
cmake .. \
|
||||
-GNinja \
|
||||
@@ -118,6 +156,7 @@ RUN echo "Building for CUDA architecture: sm_${CUDA_ARCH}" && \
|
||||
-DCMAKE_CUDA_ARCHITECTURES="${CUDA_ARCH}" \
|
||||
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
|
||||
-DCMAKE_CXX_FLAGS="-Wno-class-memaccess -Wno-error=class-memaccess -I/usr/local/include/x86_stubs" \
|
||||
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
|
||||
|
||||
# Build external dependencies first (cacheable layer)
|
||||
@@ -142,14 +181,28 @@ RUN ninja paddle_python || true
|
||||
# Create output directory
|
||||
RUN mkdir -p /output
|
||||
|
||||
# Build wheel package
|
||||
# Build wheel package - try multiple methods since PaddlePaddle build structure varies
|
||||
WORKDIR /build/Paddle
|
||||
RUN cd python && python setup.py bdist_wheel || pip wheel . -w dist/
|
||||
RUN echo "=== Looking for wheel build method ===" && \
|
||||
ls -la python/ 2>/dev/null && \
|
||||
ls -la build/python/ 2>/dev/null && \
|
||||
if [ -f build/python/setup.py ]; then \
|
||||
echo "Using build/python/setup.py" && \
|
||||
cd build/python && python setup.py bdist_wheel; \
|
||||
elif [ -f python/setup.py ]; then \
|
||||
echo "Using python/setup.py" && \
|
||||
cd python && python setup.py bdist_wheel; \
|
||||
else \
|
||||
echo "Looking for existing wheel..." && \
|
||||
find /build -name "paddlepaddle*.whl" -type f 2>/dev/null; \
|
||||
fi
|
||||
|
||||
# Copy wheel to output
|
||||
RUN cp python/dist/*.whl /output/ 2>/dev/null || \
|
||||
cp build/python/dist/*.whl /output/ 2>/dev/null || \
|
||||
find /build -name "paddlepaddle*.whl" -exec cp {} /output/ \;
|
||||
RUN find /build -name "paddlepaddle*.whl" -type f -exec cp {} /output/ \; && \
|
||||
ls -la /output/ && \
|
||||
if [ ! "$(ls -A /output/*.whl 2>/dev/null)" ]; then \
|
||||
echo "ERROR: No wheel found!" && exit 1; \
|
||||
fi
|
||||
|
||||
# List what was built
|
||||
RUN ls -la /output/ && \
|
||||
|
||||
Reference in New Issue
Block a user