Ben Vanik | 11ced0c | 2023-11-03 14:24:08 -0700 | [diff] [blame] | 1 | // 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 Vanik | 3ca0a49 | 2024-05-07 14:38:36 -0700 | [diff] [blame] | 15 | util.global private @a0 = #flow.parameter.named<"a0"> : tensor<4xi64> |
| 16 | util.global private @a1 = #flow.parameter.named<"a1"> : tensor<4xi64> |
| 17 | util.global private @b0 = #flow.parameter.named<"b0"> : tensor<8xi64> |
| 18 | util.global private @b1 = #flow.parameter.named<"b1"> : tensor<8xi64> |
Ben Vanik | 11ced0c | 2023-11-03 14:24:08 -0700 | [diff] [blame] | 19 | func.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 | } |