Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/intel_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,16 @@ jobs:
gpu: BMG
intel_graphics: ROLLING
sycl_target: intel_gpu_bmg_g21
igc_version_major: 2
igc_version_minor: 18
runner: bmg108629-01
- compiler: RELEASE
gpu: PVC
intel_graphics: ROLLING
sycl_target: intel_gpu_pvc
igc_version_major: 2
igc_version_minor: 11
runner: pvc146162-01
- compiler: NIGHTLY
gpu: PVC
intel_graphics: ROLLING
sycl_target: intel_gpu_pvc
igc_version_major: 2
igc_version_minor: 11
runner: pvc146162-01

name: Run Intel ${{ matrix.compiler }} tests on ${{ matrix.gpu }} with intel-graphics ${{ matrix.intel_graphics }}
Expand Down Expand Up @@ -103,14 +97,13 @@ jobs:
which $CXX
$CXX --version
sycl-ls

- name: Build
shell: bash
run: |
cmake -G Ninja \
-DCUTLASS_ENABLE_SYCL=ON \
-DDPCPP_SYCL_TARGET=${{ matrix.sycl_target }} \
-DIGC_VERSION_MAJOR=${{ matrix.igc_version_major }} \
-DIGC_VERSION_MINOR=${{ matrix.igc_version_minor }} \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCUTLASS_SYCL_RUNNING_CI=ON
cmake --build .
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/intel_test_gpp_host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,11 @@ jobs:
gpu: BMG
intel_graphics: ROLLING
sycl_target: intel_gpu_bmg_g21
igc_version_major: 2
igc_version_minor: 18
runner: bmg108629-01
- compiler: RELEASE
gpu: PVC
intel_graphics: ROLLING
sycl_target: intel_gpu_pvc
igc_version_major: 2
igc_version_minor: 11
runner: pvc146162-01


Expand Down Expand Up @@ -81,14 +77,13 @@ jobs:
$CXX --version
g++-13 --version
sycl-ls

- name: Build
shell: bash
run: |
cmake -G Ninja \
-DCUTLASS_ENABLE_SYCL=ON \
-DDPCPP_SYCL_TARGET=${{ matrix.sycl_target }} \
-DIGC_VERSION_MAJOR=${{ matrix.igc_version_major }} \
-DIGC_VERSION_MINOR=${{ matrix.igc_version_minor }} \
-DCUTLASS_SYCL_RUNNING_CI=ON \
-DCMAKE_CXX_FLAGS="-Werror" \
-DDPCPP_HOST_COMPILER=g++-13
Expand Down
76 changes: 76 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,67 @@ option(CUTLASS_SYCL_BUILTIN_ENABLE "Enable this option to use builtin functions
if (CUTLASS_ENABLE_SYCL)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Auto-detect IGC version for Intel targets
function(detect_igc_version)
# Check if IGC_VERSION_MAJOR/MINOR are already set
if(IGC_VERSION_MAJOR AND IGC_VERSION_MINOR)
# Validate minimum version requirement (IGC 2.18+ for PVC features)
if(IGC_VERSION_MAJOR LESS 2 OR (IGC_VERSION_MAJOR EQUAL 2 AND IGC_VERSION_MINOR LESS 18))
message(WARNING "User-provided IGC version ${IGC_VERSION_MAJOR}.${IGC_VERSION_MINOR} is below minimum requirement. Enforcing IGC 2.18 minimum for PVC compatibility.")
set(IGC_VERSION_MAJOR 2 PARENT_SCOPE)
set(IGC_VERSION_MINOR 18 PARENT_SCOPE)
message(STATUS "Using enforced minimum IGC version: 2.18")
else()
message(STATUS "Using user-provided IGC version: ${IGC_VERSION_MAJOR}.${IGC_VERSION_MINOR}")
endif()
return()
endif()

# Try ocloc query for driver version
find_program(OCLOC_EXECUTABLE ocloc)
if(OCLOC_EXECUTABLE)
execute_process(
COMMAND ${OCLOC_EXECUTABLE} query OCL_DRIVER_VERSION
OUTPUT_VARIABLE OCL_DRIVER_VERSION
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Extract driver minor version from 25.X.Y format
if(OCL_DRIVER_VERSION MATCHES "^25\\.([0-9]+)")
set(DRIVER_MINOR ${CMAKE_MATCH_1})

# Map driver version to IGC version (enforce minimum 2.18 for PVC compatibility)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it would be quite a bit easier if we directly do add_compile_defintion of the minor, major of the Neo runtime version and then use that in the code to decide whether the test should be run. Sorry I should have suggested that in the first place. Up to you whether you still want to change this or keep this because it is already implemented.

if(DRIVER_MINOR EQUAL 42)
set(IGC_MAJOR 2)
set(IGC_MINOR 21)
elseif(DRIVER_MINOR GREATER_EQUAL 39)
set(IGC_MAJOR 2)
set(IGC_MINOR 20)
elseif(DRIVER_MINOR GREATER_EQUAL 37)
set(IGC_MAJOR 2)
set(IGC_MINOR 19)
elseif(DRIVER_MINOR GREATER_EQUAL 34)
set(IGC_MAJOR 2)
set(IGC_MINOR 18)
else()
# For any older driver, use IGC 2.18 minimum (required for PVC features)
set(IGC_MAJOR 2)
set(IGC_MINOR 18)
endif()

set(IGC_VERSION_MAJOR ${IGC_MAJOR} PARENT_SCOPE)
set(IGC_VERSION_MINOR ${IGC_MINOR} PARENT_SCOPE)
message(STATUS "Auto-detected IGC version: ${IGC_MAJOR}.${IGC_MINOR} (driver ${OCL_DRIVER_VERSION})")
return()
endif()
endif()

# Fallback to PVC-safe default
set(IGC_VERSION_MAJOR 2 PARENT_SCOPE)
set(IGC_VERSION_MINOR 18 PARENT_SCOPE)
message(WARNING "Could not detect IGC version. Using IGC 2.18 default (PVC-compatible). Override with -DIGC_VERSION_MAJOR=X -DIGC_VERSION_MINOR=Y")
endfunction()

if(DPCPP_SYCL_TARGET STREQUAL "nvptx64-nvidia-cuda")
set(SYCL_NVIDIA_TARGET ON)
add_compile_definitions(SYCL_NVIDIA_TARGET)
Expand All @@ -133,6 +194,21 @@ if (CUTLASS_ENABLE_SYCL)
DPCPP_SYCL_TARGET STREQUAL "intel_gpu_bmg_g21")
set(SYCL_INTEL_TARGET ON)
add_compile_definitions(SYCL_INTEL_TARGET)

# Auto-detect IGC version for Intel targets
detect_igc_version()

# Make IGC version variables cacheable so users can override them
set(IGC_VERSION_MAJOR ${IGC_VERSION_MAJOR} CACHE STRING "Intel Graphics Compiler major version")
set(IGC_VERSION_MINOR ${IGC_VERSION_MINOR} CACHE STRING "Intel Graphics Compiler minor version")

message(STATUS "Using IGC version: ${IGC_VERSION_MAJOR}.${IGC_VERSION_MINOR}")

# Note about SPIR-V targets
if(DPCPP_SYCL_TARGET STREQUAL "spir64")
message(STATUS "Note: For SPIR-V targets, IGC version is determined at runtime. "
"The detected version (${IGC_VERSION_MAJOR}.${IGC_VERSION_MINOR}) may differ from runtime IGC.")
endif()
add_compile_options(-Wall
-Wno-unused-variable
-Wno-unused-local-typedef
Expand Down
7 changes: 0 additions & 7 deletions test/unit/cute/intel_xe/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

if(NOT DEFINED IGC_VERSION_MAJOR)
set(IGC_VERSION_MAJOR 2)
endif()
if(NOT DEFINED IGC_VERSION_MINOR)
set(IGC_VERSION_MINOR 18)
endif()

add_compile_definitions(
IGC_VERSION_MAJOR=${IGC_VERSION_MAJOR}
IGC_VERSION_MINOR=${IGC_VERSION_MINOR}
Expand Down
Loading