How to enable AMP


I would like to enable AMP to reduce the used memory and time in training simnet model.
However it looks like not to work.
Could you show me how to enable AMP?

Our Environment
HW ; AWS EC2 g4dn.xlarge
Amazon EC2 G4 Instances — Amazon Web Services (AWS)
SimNet Version 21.06(docker container)
Example : helmholtz

Result(2 cases)

Case 1. without modifying code
%python ./ --amp AMP

[0m: AdamOptimizer, /usr/local/lib/python3.8/dist-packages/simnet-21.6-py3.8.egg/simnet/
beta1: 0.9
beta2: 0.999
epsilon: 1e-08
amp: False

  • AMP is inactivate.

Case 2. with modify /simnet/build/lib/simnet/
fix the default value of AMP True
%vi /simnet/build/lib/simnet/

help=‘use Automatic Mixed Precision (AMP)? (0/1)’,

%python ./ --amp AMP
result was same as Case.1

Also in the both of case1 and 2 the training time was almost same as the case without --amp AMP option.

Toshiaki Yokoi

Thanks for reporting this. This is a bug and will be fixed in the next release. For now you can activate AMP by changing the environment variable:


Please note that there are known issues with AMP when used for second and higher-order derivatives, and with AMP your training loss may go to NaN/Inf. We are working on fixing this issue.


Thank you for your reply.
I’m trying that.

Thanks a lot,
Toshiaki Yokoi