Skip to content

Commit

Permalink
Add MLIR test files (#1044)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Nov 6, 2024
1 parent cc6fcba commit 8acfb9c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
9 changes: 8 additions & 1 deletion source/mlir.js
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,11 @@ mlir.Parser = class {
} else if (this._match(mlir.TokenType.INTEGER_LITERAL)) {
const value = this._eat(mlir.TokenType.INTEGER_LITERAL);
inputs.push(value.value);
} else if (this._match(mlir.TokenType.BOOLEAN_LITERAL)) {
const value = this._eat(mlir.TokenType.BOOLEAN_LITERAL);
inputs.push(value.value);
} else if (this._match(mlir.TokenType.KEYWORD) && this._current.value === 'loc') {
break;
} else {
throw new mlir.Error(`Unexpected token '${this._current.type}' ${this._tokenizer.location()}`);
}
Expand Down Expand Up @@ -1152,8 +1157,10 @@ mlir.Parser = class {
let name = null;
if (this._match(mlir.TokenType.IDENTIFIER)) {
name = this._read(mlir.TokenType.IDENTIFIER).value;
} else {
} else if (this._match(mlir.TokenType.STRING_LITERAL)) {
name = this._read(mlir.TokenType.STRING_LITERAL).value;
} else if (this._match(mlir.TokenType.KEYWORD)) {
name = this._read(mlir.TokenType.KEYWORD).value;
}
if (this._eat('=')) {
let value = '';
Expand Down
23 changes: 22 additions & 1 deletion test/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -3131,6 +3131,13 @@
"format": "MLIR",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
"type": "mlir",
"target": "gemmreluadd.onnx.mlir",
"source": "https://github.com/user-attachments/files/17640922/gemmreluadd.onnx.mlir.zip[gemmreluadd.onnx.mlir]",
"format": "MLIR",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
"type": "mlir",
"target": "mlp.mlir",
Expand All @@ -3147,6 +3154,13 @@
"error": "Unexpected token '=' at 3:63.",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
"type": "mlir",
"target": "mnist.onnx.mlir",
"source": "https://github.com/user-attachments/files/17640924/mnist.onnx.mlir.zip[mnist.onnx.mlir]",
"format": "MLIR",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
"type": "mlir",
"target": "model.mlirbc",
Expand All @@ -3163,12 +3177,19 @@
"error": "Invalid file content. File contains MLIR bytecode data.",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
"type": "mlir",
"target": "resnet18-v1-op13-fp32-onnxzoo-simplified.onnx.mlir",
"source": "https://github.com/user-attachments/files/17640926/resnet18-v1-op13-fp32-onnxzoo-simplified.onnx.mlir.zip[resnet18-v1-op13-fp32-onnxzoo-simplified.onnx.mlir]",
"format": "MLIR",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
"type": "mlir",
"target": "torch_mlir_3429.mlir",
"source": "https://github.com/user-attachments/files/17605115/torch_mlir_3429.mlir.zip[torch_mlir_3429.mlir]",
"format": "MLIR",
"error": "Unexpected token 'KEYWORD' at 8:34.",
"error": "Unexpected operation '!' at 14:71.",
"link": "https://github.com/lutzroeder/netron/issues/1044"
},
{
Expand Down

0 comments on commit 8acfb9c

Please sign in to comment.