Import Time Increase from Kaolin 0.16 Due to Warp Initialization
Opened this issue · 0 comments
Description:
Starting with Kaolin 0.16, importing Kaolin functions unrelated to the physics module triggers Warp initialization, resulting in increased import time.
Steps to Reproduce:
- Install Kaolin 0.16.
- Import any Kaolin module unrelated to the physics functionality.
- Observe the increased import time compared to previous versions.
Cause:
The root cause lies in the kaolin/__init__.py
file, where from . import physics
is invoked. This cascades into:
from . import simplicits
from .losses_warp import *
The final step initializes Warp:
Expected Behavior:
Kaolin modules unrelated to physics should not trigger Warp initialization, allowing for faster import times.
Proposed Solution:
Defer Warp initialization until it is explicitly needed, such as during the first call to a physics function. This ensures that importing Kaolin functions unrelated to Warp remains efficient, as was the case in versions prior to 0.16.
Additional Notes:
This change will improve the usability of Kaolin for non-physics applications, maintaining consistency with the behavior of earlier versions.