Skip to content

Instantly share code, notes, and snippets.

View archana-ramalingam's full-sized avatar

Archana Ramalingam archana-ramalingam

View GitHub Profile
@archana-ramalingam
archana-ramalingam / gist:589f408ec15e92c0d91df6a7dd4b7823
Last active May 7, 2024 23:21
ReduceLogSumExp Op PR #1880, lit test failure
[1/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.affine
[2/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.amdgpu
[3/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.async.ops_gen
[4/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.builtin
[5/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.builtin.ops_gen
[6/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.affine.ops_gen
[7/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.bufferization
[8/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.complex
[9/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSources.Dialects.complex.ops_gen
[10/94] Running utility command for TorchMLIRPythonModules.sources.MLIRPythonSourc
@archana-ramalingam
archana-ramalingam / gist:0e031403e793cf8f0ee8a8d118a184be
Last active April 30, 2024 20:43
IR dump for reducelogsumexp
//===-------------------------------------------===//
Legalizing operation : 'func.func'(0x55c90793ecc0) {
* Fold {
} -> FAILURE : unable to fold
} -> FAILURE : no matched legalization pattern
//===-------------------------------------------===//
//===-------------------------------------------===//
Legalizing operation : 'torch.operator'(0x55c907983b50) {
@archana-ramalingam
archana-ramalingam / ReduceLogSum_log.txt
Created May 8, 2024 23:24
SHARK-TestSuite e2e tests - Non-deterministic behavior consecutive runs
***************ReduceLogSum first run****************
(e2e) aramalin@aramalin-navi3:~/Documents/Nod/SHARK-TestSuite/e2eshark$ PYTHONPATH="/home/aramalin/Documents/Nod/torch-mlir/build/tools/torch-mlir/python_packages/torch_mlir:$PYTHONPATH" python ./run.py -c /home/aramalin/Documents/Nod/torch-mlir/build -i /home/aramalin/Documents/Nod/iree-build --tests onnx/operators/ReduceLogSum --verbose --cachedir /tmp/ --verbose --torchtolinalg
Starting e2eshark tests. Using 4 processes
Cache Directory: /tmp
Test run with arguments: {'backend': 'llvm-cpu', 'todtype': 'default', 'frameworks': ['pytorch'], 'groups': ['operators', 'combinations'], 'ireebuild': '/home/aramalin/Documents/Nod/iree-build', 'jobs': 4, 'torchmlirbuild': '/home/aramalin/Documents/Nod/torch-mlir/build', 'torchtolinalg': True, 'mode': 'onnx', 'norun': False, 'postprocess': False, 'report': False, 'reportformat': 'pipe', 'runfrom': 'model-run', 'runupto': 'inference', 'rundirectory': 'test-run', 'skiptestsfile': None, 'uploadtestsfile': None, 'tes
@archana-ramalingam
archana-ramalingam / debug_reducelogsumexp.log
Last active May 10, 2024 16:57
SHARK-TestSuite/e2eshark - reducelogsumexp op torch-mlir failure
Args: /home/aramalin/Documents/Nod/torch-mlir/build/bin/torch-mlir-opt --mlir-print-debuginfo --debug --mlir-print-ir-after-all --convert-torch-onnx-to-torch --convert-torch-to-linalg /home/aramalin/Documents/Nod/SHARK-TestSuite/e2eshark/test-run/onnx/operators/ReduceLogSumExp/ReduceLogSumExp.default.torch-onnx.mlir
Load new dialect in Context builtin
ImplicitTypeIDRegistry::lookupOrInsert(mlir::ShapedType)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::MemRefLayoutAttrInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::TypedAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::ElementsAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::DistinctAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::BytecodeOpInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::SymbolOpInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::OpAsmOpInterface)
@archana-ramalingam
archana-ramalingam / debug_reducelogsum.log
Created May 9, 2024 00:43
SHARK-TestSuite/e2eshark - debug reducelogsum op
Args: /home/aramalin/Documents/Nod/torch-mlir/build/bin/torch-mlir-opt --mlir-print-debuginfo --debug --mlir-print-ir-after-all --convert-torch-onnx-to-torch --convert-torch-to-linalg /home/aramalin/Documents/Nod/SHARK-TestSuite/e2eshark/test-run/onnx/operators/ReduceLogSum/ReduceLogSum.default.torch-onnx.mlir
Load new dialect in Context builtin
ImplicitTypeIDRegistry::lookupOrInsert(mlir::ShapedType)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::MemRefLayoutAttrInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::TypedAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::ElementsAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::DistinctAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::BytecodeOpInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::SymbolOpInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::OpAsmOpInterface)
@archana-ramalingam
archana-ramalingam / debug_reducelogsumexp.log
Created May 10, 2024 02:43
SHARK-TestSuite e2e test failure
ReduceLogSumExp.default.torch-onnx.mlir:4:10: error: failed to legalize operation 'torch.operator' that was explicitly marked illegal
%0 = torch.operator "onnx.ReduceLogSumExp"(%arg0) : (!torch.vtensor<[2,3,4],f32>) -> !torch.vtensor<[1,1,1],f32>
^
ReduceLogSumExp.default.torch-onnx.mlir:4:10: note: see current operation: %0 = "torch.operator"(%arg0) <{name = "onnx.ReduceLogSumExp"}> : (!torch.vtensor<[2,3,4],f32>) -> !torch.vtensor<[1,1,1],f32>
@archana-ramalingam
archana-ramalingam / ReduceLogSumExp_e2e_test.txt
Last active May 11, 2024 05:05
SHARK-TestSuite/e2eshark/test-run/onnx/operators/ReduceLogSumExp/torch-mlir.log
%int7 = torch.constant.int 7 castDType
!torch.vtensor<[2,3,4],f64> f64ResultType
%0 = torch.aten.to.dtype %arg0, %int7, %false, %false, %none_0 : !torch.vtensor<[2,3,4],f32>, !torch.int, !torch.bool, !torch.bool, !torch.none -> !torch.vtensor<[2,3,4],f64> AtenToDtypeOp
%1 = torch.aten.exp %0 : !torch.vtensor<[2,3,4],f64> -> !torch.vtensor<[2,3,4],f64> AtenExpOp
!torch.vtensor<[1,1,1],f64> f64ReduceType
%3 = torch.aten.sum.dim_IntList %1, %2, %true, %none_1 : !torch.vtensor<[2,3,4],f64>, !torch.list<int>, !torch.bool, !torch.none -> !torch.vtensor<[1,1,1],f64> reducedSumImpl
%4 = torch.aten.log %3 : !torch.vtensor<[1,1,1],f64> -> !torch.vtensor<[2,3,4],f64> AtenLogOp
%4 = torch.aten.log %3 : !torch.vtensor<[1,1,1],f64> -> !torch.vtensor<[2,3,4],f64> finalResult
ReduceLogSumExp.default.torch-onnx.mlir:4:10: error: 'tensor.cast' op operand type 'tensor<1x1x1xf64>' and result type 'tensor<2x3x4xf64>' are cast incompatible
%0 = torch.operator "onnx.ReduceLogSumExp"(%arg0) : (!torch.vtensor<[2,3,4],f32>) -> !to
@archana-ramalingam
archana-ramalingam / debug_reducelogsumexp.log
Created May 11, 2024 05:03
torch-mlir-opt debug for reducelogsumexp mlir
Args: /home/archana/src/torch-mlir/build/bin/torch-mlir-opt --mlir-print-debuginfo --debug --mlir-print-ir-after-all --convert-torch-onnx-to-torch --convert-torch-to-linalg /home/archana/src/SHARK-TestSuite/e2eshark/test-run/onnx/operators/ReduceLogSumExp/ReduceLogSumExp.default.torch-onnx.mlir
Load new dialect in Context builtin
ImplicitTypeIDRegistry::lookupOrInsert(mlir::ShapedType)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::MemRefLayoutAttrInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::TypedAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::ElementsAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::DistinctAttr)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::BytecodeOpInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::SymbolOpInterface)
ImplicitTypeIDRegistry::lookupOrInsert(mlir::OpAsmOpInterface)