CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
55 lines
2.7 KiB
MLIR
55 lines
2.7 KiB
MLIR
// RUN: mlir-opt \
|
|
// RUN: --pass-pipeline="builtin.module(func.func(shard-partition,test-single-fold))" \
|
|
// RUN: -verify-diagnostics %s
|
|
|
|
shard.grid @grid(shape = 2)
|
|
|
|
// expected-error @+1 {{Cannot partition: expected a shard.shard op for block argument 0 in block 0}}
|
|
func.func @test_block_arg_missing_shard(%arg0: tensor<6xi32>) -> tensor<6xi32> {
|
|
%sharding = shard.sharding @grid split_axes = [[0]] : !shard.sharding
|
|
%2 = tosa.abs %arg0 : (tensor<6xi32>) -> tensor<6xi32>
|
|
%sharded = shard.shard %2 to %sharding annotate_for_users : tensor<6xi32>
|
|
return %2 : tensor<6xi32>
|
|
}
|
|
|
|
func.func @test_operand_missing_annotate(%arg0: tensor<6xi32>) -> tensor<6xi32> {
|
|
%sharding = shard.sharding @grid split_axes = [[0]] : !shard.sharding
|
|
%2 = shard.shard %arg0 to %sharding : tensor<6xi32>
|
|
// expected-error @+1 {{Cannot partition: shard.shard for operand 0 must set 'annotate_for_users'.}}
|
|
%3 = tosa.rsqrt %2 : (tensor<6xi32>) -> tensor<6xi32>
|
|
%4 = tosa.rsqrt %3 : (tensor<6xi32>) -> tensor<6xi32>
|
|
%sharded = shard.shard %4 to %sharding annotate_for_users : tensor<6xi32>
|
|
return %sharded : tensor<6xi32>
|
|
}
|
|
|
|
func.func @test_result_missing_sharding() -> tensor<6xi32> {
|
|
%sharding = shard.sharding @grid split_axes = [[0]] : !shard.sharding
|
|
// expected-error @+1 {{Cannot partition: user of result 0 must be shard.shard operation.}}
|
|
%1 = tensor.empty() : tensor<6xi32>
|
|
%3 = tosa.rsqrt %1 : (tensor<6xi32>) -> tensor<6xi32>
|
|
%4 = shard.shard %3 to %sharding : tensor<6xi32>
|
|
%sharded = shard.shard %4 to %sharding annotate_for_users : tensor<6xi32>
|
|
return %sharded : tensor<6xi32>
|
|
}
|
|
|
|
func.func @test_multiple_users(%arg0: tensor<6xi32>) -> tensor<6xi32> {
|
|
%sharding = shard.sharding @grid split_axes = [[0]] : !shard.sharding
|
|
%1 = shard.shard %arg0 to %sharding : tensor<6xi32>
|
|
%2 = shard.shard %1 to %sharding annotate_for_users : tensor<6xi32>
|
|
// expected-error @+1 {{Cannot partition: result 0 must have exactly one use.}}
|
|
%3 = tosa.rsqrt %2 : (tensor<6xi32>) -> tensor<6xi32>
|
|
%4 = shard.shard %3 to %sharding : tensor<6xi32>
|
|
%sharded = shard.shard %3 to %sharding annotate_for_users : tensor<6xi32>
|
|
return %sharded : tensor<6xi32>
|
|
}
|
|
|
|
func.func @test_result_invalid_annotate(%arg0: tensor<6xi32>) -> tensor<6xi32> {
|
|
%sharding = shard.sharding @grid split_axes = [[0]] : !shard.sharding
|
|
%1 = shard.shard %arg0 to %sharding : tensor<6xi32>
|
|
%2 = shard.shard %1 to %sharding annotate_for_users : tensor<6xi32>
|
|
// expected-error @+1 {{Cannot partition: shard.shard for result 0 must not set 'annotate_for_users'.}}
|
|
%3 = tosa.rsqrt %2 : (tensor<6xi32>) -> tensor<6xi32>
|
|
%sharded = shard.shard %3 to %sharding annotate_for_users : tensor<6xi32>
|
|
return %sharded : tensor<6xi32>
|
|
}
|