How to choose the dialects to compile which is used in python

Right now I am using the following list of dialects in MLIR: func, tosa, quant.
And I am wondering if there is some way to only compile these dialects above and generate some smaller lib files so that I can import and use them in python.