I have a pass which is doing conversion from onnx dialect to std/affine/custom diatect using applyPartialConversion() api. For approximate 1000 operations, it works seamlessly. However, when the operation count reaches to 1500 to 2000, it is getting hanged. It is not coming out of the conversion routine. All the operations are same and each onnx operation is getting lowered to approximate 3-4 operations.
Is there any memory constraints on the number of operations?
There is no obvious “memory limitation” and even if there was one, it wouldn’t have led to hanging but rather to the process being stopped due to out-of-memory. Also 1000 operations is by far not in the ballpark of large modules, we have converted with hundreds of thousands with no problem.
It is very hard to debug without any concrete details. Since you have custom dialects, I could suspect that some rewrite patterns may be creating weird cycles in the IR, e.g., by adding new uses of values defined by to-be-erased operations. You should be able to attach the debugger, interrupt the execution and see where in the call stack the code is, several times, to get the idea.