aimet icon indicating copy to clipboard operation
aimet copied to clipboard

hard-coded `WORKING_DIR` in `adaround_weight.py` and `quantsim.py`

Open FelixSchwarz opened this issue 1 year ago • 2 comments

There is a module-level variable named WORKING_DIR in different Python modules. That variable is hard-coded to some path in /tmp, e.g. WORKING_DIR = '/tmp/quantsim/' (1, 2).

Hard-coding the temp directory can break some workflows where the temporary directory is located somewhere else. If you just use Python's tempfile module, we could use common environment variables to configure the location.

Also you might want to consider if aimet_onnx.QuantizationSimModel.save_model_graph() could just get a Path instance and store the model there.

FelixSchwarz avatar Oct 09 '23 07:10 FelixSchwarz

btw: this might be flagged as a security issue by infra when we deploy aimet (insecure tempfile creation).

FelixSchwarz avatar Oct 09 '23 12:10 FelixSchwarz

@FelixSchwarz Thanks for your suggestions! We will pick this up soon but feel free to raise a PR. Thank you.

quic-hitameht avatar Oct 11 '23 06:10 quic-hitameht