ptrendx commented on pull request #20635:
URL: https://github.com/apache/incubator-mxnet/pull/20635#issuecomment-966460678


   I agree that the number of env variables is quite large. The best solution I 
think would be to have some singleton object storing all settings that the user 
could write to, e.g. something like
   ```
   mxnet.settings.cudnn.only_deterministic_algos = True
   ```
   That said, this could not be a simple Python struct, as it would need to be 
connected to the backend (otherwise there would be issues like needing to drain 
the engine before setting it to avoid races and potentially having to grab a 
lock when accessing the values). I think the best way of doing such thing would 
be to have it as a resource (similar to workspace or random state). For all 
affected operators it could be read-only (in order to not introduce false 
dependencies), and setting the value on the user side would invoke an engine 
operation that would write to it.
   
   That said, this would require changing the resource implementation on the 
backend side (currently all resources are used as mutated engine vars, we would 
need to allow resource accesses to be set as read-only), so it is probably not 
in the scope of this PR. It would be a nice improvement to MXNet API though I 
believe, as a lot of env variables could be dropped that way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to