현재 환경 변수를 사용하지 않고 JAX에서 GPU 메모리 preallocation을 비활성화하는 직접적인 방법은 없습니다. 권장 방법은 JAX를 가져 오기 전에 환경 변수`XLA_PYTHON_CLIENT_PREALLOCATE`를` 'false'로 설정하는 것과 관련이 있습니다. 이것은`os.environ [ 'xla_python_client_preallocate'] = 'false'`]를 사용하여 Python 스크립트 내에서 수행 할 수 있습니다. 또는`XLA_PYTHON_CLIENT_PREALLOCATE = false` (unix-like systems) 또는'set set으로 스크립트를 실행하기 전에 외부로 설정하여 외부로 설정하여 수행 할 수 있습니다. xla_python_client_preallocate = false` (Windows).
그러나 JAX를 가져 오기 전에 이러한 환경 변수를 설정하는 것이 중요합니다. 나중에 설정하는 것은 효과가 없기 때문에 [1] [3]. 환경 변수를 사용하지 않고 PrealLocation을 비활성화 할 수있는 내장 JAX 기능 또는 구성이 없습니다.
새로운 버전의 JAX에서 PrealLocation을 사용하지 않는 문제가 발생하면 버그 때문일 수 있으며 업데이트에 대한 최신 문서 또는 릴리스 노트를 확인하는 것이 좋습니다 [9].
인용 :[1] https://github.com/jax-ml/jax/discussions/21962
[2] https://learn.microsoft.com/en-us/windows/win32/msi/environment-table
[3] https://jax.readthedocs.io/en/latest/gpu_memory_allocation.html
[4] https://docs.jax.dev/en/latest/jep/4410-omnistaging.html
[5] https://kolonist26-jax-kr.readthedocs.io/en/latest/gpu_memory_allocation.html
[6] https://developer.jboss.org/thread/215838
[7] https://crikit.science/documentation/ad_systems/
[8] https://docs.nvidia.com/deeplearning/dali/user-guide/docs/advanccics_performance_tuning.html
[9] https://github.com/jax-ml/jax/discussions/19014