Skip to content

RESOURCE_EXHAUSTED error when running linalg.matmul #139

@EmilySillars

Description

@EmilySillars

Full console output after running /toolchain/bin/snitch_cluster.vlt build/runtime/samples/pomelo/pomelo:

[fesvr] Wrote 36 bytes of bootrom to 0x1000
[fesvr] Wrote entry point 0x80000000 to bootloader slot 0x1020
[fesvr] Wrote 56 bytes of bootdata to 0x1024
[Tracer] Logging Hart          8 to logs/trace_hart_00000008.dasm
[Tracer] Logging Hart          0 to logs/trace_hart_00000000.dasm
[Tracer] Logging Hart          1 to logs/trace_hart_00000001.dasm
[Tracer] Logging Hart          2 to logs/trace_hart_00000002.dasm
[Tracer] Logging Hart          3 to logs/trace_hart_00000003.dasm
[Tracer] Logging Hart          4 to logs/trace_hart_00000004.dasm
[Tracer] Logging Hart          5 to logs/trace_hart_00000005.dasm
[Tracer] Logging Hart          6 to logs/trace_hart_00000006.dasm
[Tracer] Logging Hart          7 to logs/trace_hart_00000007.dasm
RESOURCE_EXHAUSTED; while invoking native function test_pamplemousse.matmulTiny;
[ 1]   native hal.fence.create:0 -
[ 0]   native test_pamplemousse.matmulTiny:0 -

More details:

  • arith.mulf works
func.func @simple_mul(%arg0: tensor<3x3xf64>, %arg1: tensor<3x3xf64>) -> tensor<3x3xf64> {
  %0 = "arith.mulf"(%arg0, %arg1) : (tensor<3x3xf64>, tensor<3x3xf64>) -> tensor<3x3xf64>
  return %0 : tensor<3x3xf64>
  }
  • linalg.add works
func.func @matmulTiny(%lhs: tensor<3x3xf64>, %rhs: tensor<3x3xf64>, %acc: tensor<3x3xf64>) -> tensor<3x3xf64> {
  %result = linalg.add
    ins(%lhs, %rhs: tensor<3x3xf64>, tensor<3x3xf64>)
    outs(%acc: tensor<3x3xf64>)
  -> tensor<3x3xf64>
  return %result: tensor<3x3xf64>
  }

  • linalg.matmul causes RESOURCES_EXHAUSTED error
func.func @matmulTiny(%lhs: tensor<3x3xf64>, %rhs: tensor<3x3xf64>, %acc: tensor<3x3xf64>) -> tensor<3x3xf64> {
  %result = linalg.matmul
    ins(%lhs, %rhs: tensor<3x3xf64>, tensor<3x3xf64>)
    outs(%acc: tensor<3x3xf64>)
  -> tensor<3x3xf64>
  return %result: tensor<3x3xf64>
  }
  • Matrix sizes 4x4 and 64x64 also fail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions