Skip to content

Commit

Permalink
update the ock_ build to run the new riscv_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaryaSharf committed Feb 6, 2024
1 parent 39ed78e commit 899b825
Show file tree
Hide file tree
Showing 4 changed files with 389 additions and 249 deletions.
8 changes: 4 additions & 4 deletions .github/actions/build_vgg_resnet_action/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ runs:
- name: Set up environment and build networks
shell: bash
run: |
export LD_LIBRARY_PATH=${{ inputs.workspace }}/install/lib:${{ inputs.workspace }}/linux_nightly_release/lib/libsycl.so:${{ inputs.workspace }}/linux_nightly_release/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${{ inputs.workspace }}/ock_install_dir/lib:${{ inputs.workspace }}/linux_nightly_release/lib/libsycl.so:${{ inputs.workspace }}/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=${{ inputs.workspace }}/linux_nightly_release/bin/clang
export CA_HAL_DEBUG=1
export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:acc
export OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so
export OCL_ICD_FILENAMES=${{ inputs.workspace }}/ock_install_dir/lib/libCL.so
# As the oneAPI basetoolkit release has a whitelist of devices, it filters out RefSi.
# To override it, as a temporary solution we can point SYCL_CONFIG_FILE_NAME to ``.
# This way it doesn't set the default sycl.conf.
Expand Down Expand Up @@ -76,9 +76,9 @@ runs:
python $portDNN_source/samples/networks/img2bin.py $(pwd)/Labrador_Retriever_Molly.jpg
# Testing on image for VGG16
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/vgg/vgg vdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${{ inputs.workspace }}/ock_install_dir/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/vgg/vgg vdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
# Testing on image for Resnet50
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${{ inputs.workspace }}/install/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/resnet50/resnet50 rdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
CA_HAL_DEBUG=1 CA_PROFILE_LEVEL=3 OCL_ICD_FILENAMES=${{ inputs.workspace }}/ock_install_dir/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME= ${{ inputs.workspace }}/portDNN_build_dir/samples/networks/resnet50/resnet50 rdata/ $(pwd)/Labrador_Retriever_Molly.jpg.bin
- name: Package artifacts
shell: bash
Expand Down
35 changes: 26 additions & 9 deletions .github/workflows/create_publish_artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build and Package
on:
pull_request:
paths:
- '.github/workflows/create_publish_artifacts.yml'
push:
branches:
- stable
Expand Down Expand Up @@ -52,17 +55,31 @@ jobs:
mkdir linux_nightly_release
tar -xzf sycl_linux.tar.gz -C linux_nightly_release
- name: Clone oneAPI-samples
run: git clone https://github.com/oneapi-src/oneAPI-samples.git

- name: Setup environment and test Vector Add
- name: Test RSICV examples
run: |
export ONEAPI_ROOT=$(pwd)/linux_nightly_release
# Set environment variables
export LD_LIBRARY_PATH=$(pwd)/install/lib:$(pwd)/linux_nightly_release/lib/libsycl.so:$(pwd)/linux_nightly_release/lib:$LD_LIBRARY_PATH
export CMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++
export CMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang
export CA_HAL_DEBUG=1
export CA_PROFILE_LEVEL=3
export ONEAPI_DEVICE_SELECTOR=opencl:fpga
export OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so
export PATH=$(pwd)/linux_nightly_release/bin:$PATH
export LD_LIBRARY_PATH=$(pwd)/linux_nightly_release/lib:$(pwd)/install/lib:$LD_LIBRARY_PATH
# As the oneAPI basetoolkit release has a whitelist of devices, it filters out RefSi.
# To override it, as a temporary solution we can point SYCL_CONFIG_FILE_NAME to ``.
# This way it doesn't set the default sycl.conf.
export SYCL_CONFIG_FILE_NAME=""
mkdir build_ock_tests
cmake -GNinja -Bbuild_ock_tests -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DCMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/linux_nightly_release/include/sycl $(pwd)/examples/applications
ninja -C build_ock_tests
cd build_ock_tests
# Run tests
$(pwd)/linux_nightly_release/bin/clang++ -fsycl $(pwd)/oneAPI-samples/DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp -o vect
CA_RISCV_DUMP_IR=1 CA_HAL_DEBUG=1 OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME="" ./vect
ctest bin/ --verbose
cd ..
- name: Package Artifacts
run: |
Expand Down Expand Up @@ -95,4 +112,4 @@ jobs:
name: OCK daily ${{ steps.tag.outputs.TAG }}
prerelease: true
body: "Daily build ${{ steps.tag.outputs.TAG }}"
target_commitish: ${{ github.sha }}
target_commitish: ${{ github.sha }}
23 changes: 6 additions & 17 deletions .github/workflows/run_ock_demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,6 @@ jobs:
mkdir linux_nightly_release
tar -xzf sycl_linux.tar.gz -C linux_nightly_release
- name: Clone oneAPI-samples
run: git clone https://github.com/oneapi-src/oneAPI-samples.git

- name: Setup environment and test Vector Add
run: |
export ONEAPI_ROOT=$(pwd)/linux_nightly_release
export PATH=$(pwd)/linux_nightly_release/bin:$PATH
export LD_LIBRARY_PATH=$(pwd)/linux_nightly_release/lib:$(pwd)/install/lib:$LD_LIBRARY_PATH
$(pwd)/linux_nightly_release/bin/clang++ -fsycl $(pwd)/oneAPI-samples/DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp -o vect
CA_RISCV_DUMP_IR=1 CA_HAL_DEBUG=1 OCL_ICD_FILENAMES=$(pwd)/install/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl:acc SYCL_CONFIG_FILE_NAME="" ./vect
- name: Test RSICV examples
run: |
# Set environment variables
Expand All @@ -84,12 +72,12 @@ jobs:
# This way it doesn't set the default sycl.conf.
export SYCL_CONFIG_FILE_NAME=""
mkdir build_riscv_tests
cmake -GNinja -Bbuild_riscv_tests -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DCMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/linux_nightly_release/include/sycl $(pwd)/examples/applications
ninja -C build_riscv_tests
mkdir ock_example_tests
cmake -GNinja -Bock_example_tests -DCMAKE_CXX_COMPILER=$(pwd)/linux_nightly_release/bin/clang++ -DCMAKE_C_COMPILER=$(pwd)/linux_nightly_release/bin/clang -DOpenCL_LIBRARY=$(pwd)/install/lib/libCL.so -DOpenCL_INCLUDE_DIR=$(pwd)/linux_nightly_release/include/sycl $(pwd)/examples/applications
ninja -C ock_example_tests
# Run tests
cd build_riscv_tests
cd ock_example_tests
ctest bin/ --verbose
cd ..
Expand All @@ -105,7 +93,8 @@ jobs:

- name: Package Build Artifacts
run: |
tar -cvzf ock_demo_artifacts.tar.gz install portDNN_build_dir portBLAS_build_dir build_riscv_tests vect examples/technical_blogs/ock_demo_blog/getting_started.md examples/technical_blogs/ock_demo_blog/envvars
mv install ock_install_dir
tar -cvzf ock_demo_artifacts.tar.gz ock_install_dir portDNN_build_dir portBLAS_build_dir ock_example_tests examples/technical_blogs/ock_demo_blog/getting_started.md examples/technical_blogs/ock_demo_blog/envvars
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
Loading

0 comments on commit 899b825

Please sign in to comment.