Skip to content

Instantly share code, notes, and snippets.

@angelz913
Last active June 11, 2024 20:28
Show Gist options
  • Save angelz913/6fa77ca1fc999ce228e0e7a503e4c23b to your computer and use it in GitHub Desktop.
Save angelz913/6fa77ca1fc999ce228e0e7a503e4c23b to your computer and use it in GitHub Desktop.

Table of Contents

  1. Weekly Progress
  2. Initial Tests
  3. Todo

Weekly Progress

June 3 - 7

  • Created new pass
  • Moved most of the parts from IREE's ConvertToSPIRVPass

June 10 - 14

  • Initial testing
  • Make todo list

Tests

ArithToSPIRV

  • arith-to-spirv-le-specific.mlir
    • Function body empty
  • arith-to-spirv-unsupported.mlir
    • @unsupported_5elem_vector (5 elements, needs vector reshape)
    • @unsupported_2x2elem_vector (2x2 needs vector reshape)
    • Remaining function bodies are empty, no errors.
  • arith-to-spirv.mlir
    • @int32_scalar_addui_extended (2 return values, not supported by SPIR-V)
  • fast-math.mlir

ComplexToSPIRV

  • complex-to-spirv.mlir

ControlFlowToSPIRV

  • cf-ops-to-spirv.mlir
    • @simple_loop
    • @main_graph

FuncToSPIRV

  • func-ops-to-spirv.mlir
    • @return_multi_val (not supported by SPIR-V)
  • types-to-spirv.mlir
    • @integer64 (FuncToSPIRV does not check for capability)
    • @integer128 (not supported by SPIR-V)
    • @float64 (FuncToSPIRV does not check for capability)
    • @memref_complex_types_no_cap
    • @memref_64bit_StorageBuffer

GPUToSPIRV

  • builtins-opencl.mlir
  • builtins-vulkan.mlir
  • entry-point.mlir
  • gpu-to-spirv.mlir
  • load-store.mlir
  • module-opencl.mlir
  • reductions.mlir
  • shuffle.mlir

IndexToSPIRV

  • index-to-spirv.mlir
    • @ceildivs
    • @ceildivu
    • @floodivs
    • @index_cast_from (4 return values)
    • @index_cast_to (4 return values)

MathToSPIRV

  • math-to-core-spirv.mlir
  • math-to-gl-spirv.mlir
    • @ctlz_scalar
    • @tensor_1d (not supported by SPIR-V, so report error?)
  • math-to-opencl-spirv.mlir
    • @float32_unary_scalar, @float32_unary_vector, @float32_binary_scalar, @float32_binary_vector, @float32_ternary_scalar, @float32_ternary_vector, @int_unary (function bodies empty)
    • @tensor_1d (not supported by SPIR-V, so report error?)

MemRefToSPIRV

  • alloc.mlir
    • @alloc_dynamic_size, @alloc_unsupported_memory_space, @dealloc_dynamic_size, @dealloc_unsupported_memory_space, @zero_size (not supported by SPIR-V)
  • alloca.mlir
    • @alloc_dynamic_size, @alloc_unsupported_memory_space, @dealloc_dynamic_size, @dealloc_unsupported_memory_space, @zero_size (not supported by SPIR-V)
  • atomic.mlir
  • bitwidth-emulation.mlir
  • map-storage-class.mlir
  • memref-to-spirv.mlir
    • @load_store_i32_physical
    • @load_store_i8_physical
    • @load_store_i1_physical
    • @load_store_f32_physical
    • @load_nontemporal_aligned

SCFToSPIRV

  • for.mlir
  • if.mlir
    • @unsupported_yield_type
  • unsupported.mlir
    • @func (scf.parallel conversion is not supported yet)
  • use-indices.mlir
    • @forward (function body empty)
  • while.mlir
    • @while_loop2
    • @while_loop_before_typeconv
    • @while_loop_after_typeconv

TensorToSPIRV

  • tensor-ops-to-spirv.mlir
    • @tensor_0d, @tensor_1d, @tensor_2d (function bodies empty)

UBToSPIRV

  • ub-to-spirv.mlir
    • @check_poison (function body empty)

VectorToSPIRV

  • vector-reduction-to-spirv-dot-prod.mlir
    • @to_sdot_i64
    • @to_sdot_acc_i64
    • @too_long
  • vector-to-spirv.mlir
    • @bitcast (2 return values?)
    • @extract_element_size5_vector (5 elements)
    • @vector_load, @vector_store, @vector_load_2d, @vector_store_2d (different from the check comments)

Todo

Vector

  • Handle vectors with illegal sizes
  • Vector rolling to transform vectors into 1-D

Multiple return values

  • SPIR-V does not support multiple return values. A spirv.func can only return zero or one values.
  • It might be possible to wrap the return values in a spirv.struct.

scf.parallel conversion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment