blob: 715f6862c5b4e9410f92c768413d663d9401cfbe [file] [log] [blame]
Ben Vanik11ced0c2023-11-03 14:24:08 -07001// RUN: (iree-compile --iree-hal-target-backends=vmvx %s | \
2// RUN: iree-run-module --device=local-sync --module=- --function=echo \
3// RUN: --parameters=%p/parameters_a.safetensors \
4// RUN: --parameters=%p/parameters_b.safetensors \
5// RUN: --expected_output=4xi64=0,1,2,3 \
6// RUN: --expected_output=4xi64=4,5,6,7 \
7// RUN: --expected_output=8xi64=8,9,10,11,12,13,14,15 \
8// RUN: --expected_output=8xi64=16,17,18,19,20,21,22,23) | \
9// RUN: FileCheck %s
10// CHECK: [SUCCESS]
11
12// Simple named parameters with no scope. Parameter files are combined at
13// runtime to allow for filesystem sharding while still providing a flat set of
14// parameters in the compiler input.
Ben Vanik3ca0a492024-05-07 14:38:36 -070015util.global private @a0 = #flow.parameter.named<"a0"> : tensor<4xi64>
16util.global private @a1 = #flow.parameter.named<"a1"> : tensor<4xi64>
17util.global private @b0 = #flow.parameter.named<"b0"> : tensor<8xi64>
18util.global private @b1 = #flow.parameter.named<"b1"> : tensor<8xi64>
Ben Vanik11ced0c2023-11-03 14:24:08 -070019func.func @echo() -> (tensor<4xi64>, tensor<4xi64>, tensor<8xi64>, tensor<8xi64>) {
20 %a0 = util.global.load @a0 : tensor<4xi64>
21 %a1 = util.global.load @a1 : tensor<4xi64>
22 %b0 = util.global.load @b0 : tensor<8xi64>
23 %b1 = util.global.load @b1 : tensor<8xi64>
24 return %a0, %a1, %b0, %b1 : tensor<4xi64>, tensor<4xi64>, tensor<8xi64>, tensor<8xi64>
25}