catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Runtime device kwargs cannot take in values with curly brakets or nested dictionaries

Open paul0403 opened this issue 9 months ago • 0 comments
trafficstars

Due to an implementation detail, namely the way the device kwargs are parsed in the runtime , there is an implicit assumption that the values of the kwargs, when converted to strings, cannot have curly brackets.

For example (pseudocode):

kwargs = "{ 'test' : '{5:{6:3.14}, 1:2, 3:4}' }" 
std::cout << parse_kwargs(kwargs)["test"];   

----------
5:6:3.14

This causes issues when, for example, a python dictionary is passed in as a kwarg, or if some devices pass in a JSON schema as a kwarg during that device's dialect lowering.

paul0403 avatar Feb 07 '25 21:02 paul0403