tutorials icon indicating copy to clipboard operation
tutorials copied to clipboard

Add Batch processing with SequenceMap tutorial

Open jantonguirao opened this issue 2 years ago • 8 comments

Adding a tutorial showing how to use the SequenceMap operator to perform batch processing operations.

Signed-off-by: Joaquin Anton [email protected]

jantonguirao avatar Mar 29 '22 09:03 jantonguirao

@jcwchen The SequenceMap operator has been merged. I think this example is ready for review.

jantonguirao avatar Apr 11 '22 07:04 jantonguirao

Thanks for the quick update after your ONNX PR. May I ask you: are you fine if we forward this PR at least after official ONNXRuntime supports new ONNX operator SequenceMap? It can prevent some confusion if users would like to try it out with current ONNX and ORT. (If we directly publish this document, they will now see couple of warnings.)

IIUC, next release for ONNX will be in May and ORT will be in June.

Sure, that seems reasonable

jantonguirao avatar Apr 15 '22 09:04 jantonguirao

Thanks for waiting. Now ONNX 1.12 has been released -- before merging it, @jantonguirao please let me know if you would like to add something else. Otherwise, I will forward this PR. Thank you

jcwchen avatar Jun 22 '22 15:06 jcwchen

Thanks for waiting. Now ONNX 1.12 has been released -- before merging it, @jantonguirao please let me know if you would like to add something else. Otherwise, I will forward this PR. Thank you

I don't have anything to add. We should probably just rerun the notebook. I have a question: shouldn't we wait until onnxruntime supports opset 17, or it is enough if it's there in ONNX?

jantonguirao avatar Jun 22 '22 16:06 jantonguirao

Good point. Let's wait for ORT 1.12.0 then (which is also coming soon). Thanks!

jcwchen avatar Jun 22 '22 16:06 jcwchen

ORT 1.12.0 has been released. @jantonguirao Shall we revive this work by updating the notebook with the latest onnx and onnxruntime? Thanks!

jcwchen avatar Aug 05 '22 00:08 jcwchen

@jcwchen I have tested with ORT 1.12.1 and unfortunately, it doesn't seem to work. I am getting errors like:

InvalidGraph: [ONNXRuntimeError] : 10 : INVALID_GRAPH : This is an invalid model. In Node, ("", Loop, "", -1) : ("_0x39b8f70_SequenceMap_input_sequence_seqlen": tensor(int64),"_0x39b8f70_SequenceMap_input_sequence_cond": tensor(bool),"_0x39b8f70_SequenceMap_out_sequence_0_seqempty": seq(tensor(uint8)),) -> ("batch_processed": seq(tensor(uint8)),) , Error Nodes in a graph must be topologically sorted, however input '_0x39b8f70_target_size' of node: 
name:  OpType: Cast
 is not output of any previous nodes.

I'll prepare a self-contained reproduction script and file a bug.

jantonguirao avatar Aug 05 '22 08:08 jantonguirao

https://github.com/microsoft/onnxruntime/issues/12491 @jcwchen FYI

jantonguirao avatar Aug 05 '22 16:08 jantonguirao

@jcwchen The issue I mentioned above is fixed with https://github.com/microsoft/onnxruntime/pull/12758 I've updated the notebook. When this PR gets merged I think we can review and merge this notebook. Thank you.

jantonguirao avatar Aug 29 '22 10:08 jantonguirao