This pull request addresses two main issues found in the models.LSI and models.ETM modules.
Changes Made
Improved Null Checks in models.LSI:
Updated comparisons from == None to is None in two locations within the models.LSI module. This change ensures a more reliable and Pythonic way of handling null checks.
Refined Device Assignment in models.ETM:
Addressed three specific device assignment issues:
CPU Use on CUDA-capable Devices: Even when the device parameter was explicitly set to 'cpu' on CUDA-capable devices, the model was still being assigned to a GPU. This has been corrected to respect the user's device preference.
GPU Selection on Multi-GPU Systems: Previously, specifying a particular GPU (e.g., 'cuda:1') on systems with multiple GPUs incorrectly defaulted to the first GPU due to automatic checks and assignments. This update ensures that the specified GPU is used as intended.
MPS Acceleration on Apple Devices: On Apple machines supporting 'mps', attempting to use MPS acceleration would default to 'cpu' when 'cuda' was unavailable. This behavior has been adjusted to properly recognize and utilize 'mps' if specified.
Rationale
These updates enhanced the usability and functionality of the affected models. By ensuring that null checks are more robust and device assignments adhere to user specifications, we can provide a more predictable and efficient user experience.
Description
This pull request addresses two main issues found in the
models.LSI
andmodels.ETM
modules.Changes Made
Improved Null Checks in
models.LSI
:== None
tois None
in two locations within themodels.LSI
module. This change ensures a more reliable and Pythonic way of handling null checks.Refined Device Assignment in
models.ETM
:Rationale
These updates enhanced the usability and functionality of the affected models. By ensuring that null checks are more robust and device assignments adhere to user specifications, we can provide a more predictable and efficient user experience.