A way to do this is by creating a new dictionary with the rounded values, you can do that in one line using dictionary comprehention while checking for non-float values as such:
Y = {k:(round(v,2) if isinstance(v,float) else v) for (k,v) in X.items()}
and then dump it. However a small note, do avoid using the word "dict" as your dictionary name, as its also a keyword in python (e.g. X = dict() is a method to create a new dictionary X). And its generally good practice to avoid those reserved keynames.
I do believe the above could could probably be optimised further (e.g, perhaps there is a function to either return the value for the round, or return a default value similar to the dictionary function get(), however I do not have any ideas on top of my mind.