Skip to content

Consider adding node labels for more diagnosable error messages for async errors. #585

@philloooo

Description

@philloooo

As a follow up of #572 , we propose platform specific validations should be done during the async build step.

This poses a challenge for developers: they submitted a complex graph and one step within the graph is failing a platform specific check, it's hard to trace back the specific operand in the graph the error is about.

I propose to follow WebGPU’s practice to define a MLObjectBase with a label field to let MLOperand extend from.
The usage would be like:

const builder = new MLGraphBuilder(context);

const A = builder.input('0', operandType);
const B = builder.input('1', operandType);

const C = builder.matmul(A, B); 
C.label = "step1:matmul";
const D = builder.add(A, C);
D.label = "step2:add";
// ... keep building a complex graph
...
const finalOperand = builder.add(E, F);

// Build the graph.
const graph = await builder.build({'output': finalOperand});


> Uncaught DOMException: Model graph build error: [Operand "step1:matmul"] input dimensions XXX exceed supported limit.

The MLObjectBase could also be extended by:

  • MLBuffer to help with debugging async buffer related errors.
  • MLGraph to help with debugging async errors from chained inference.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions