LION.utils.environment¶
The record of the environment a model was saved in.
environment_record() is written by LIONmodel.save in every model file,
as its environment (a LIONParameter, saved as plain JSON):
lion: LION’sversion; for a git checkout itscommit, the LION files withuncommittedchanges (files git tracks that changed, and untracked files that were imported), adiff_sha256of those changes, and whether the commit ispushed(in a remote branch git knows of); for an installed LION, itsdistributionversion;python, andpackages: the versions of the packages that change LION’s numbers (torch, numpy, the CT backends;Noneif not installed);torch: the CUDA and cuDNN it was built with, and its determinism settings (deterministic_algorithms,cudnn_deterministic,cudnn_benchmark): same-seed GPU runs are only identical with them on;device: the device type the model was on, the GPUs and their driver;platform: the operating system.
Nothing personal is recorded (no hostname, user or paths). A full list of the
installed packages belongs to publish(), not to every file.
code_differences(record) says how the running LION code differs from the
code a file was saved with (LIONmodel warns on load);
publish_problems(record) lists what keeps a result from being published
(uncommitted or unpushed LION code).
Functions
|
How the LION code running now differs from the code |
|
The state of the code in |
|
The environment LION runs in now (see the module docstring); |
|
Whether |
|
What keeps a result made in environment |
- LION.utils.environment.code_differences(record, folder=PosixPath('/mhome/damtp/r/ab2860/AItomotools/LION'))[source]¶
How the LION code running now differs from the code
record(an environment record) was made with, as a sentence; None if it doesn’t (or it can’t be told).
- LION.utils.environment.code_state(folder=PosixPath('/mhome/damtp/r/ab2860/AItomotools/LION'))[source]¶
The state of the code in
folder(a package in a git checkout):commit,uncommitted(files changed since it: tracked files, and untracked ones that were imported),diff_sha256(of those changes; None if there are none) andpushed(the commit is in a remote branch). All None iffolderis not in a git checkout.
- LION.utils.environment.environment_record(device=None)[source]¶
The environment LION runs in now (see the module docstring);
device: the device of the model being saved (default: LION’s default device).