OCTIS icon indicating copy to clipboard operation
OCTIS copied to clipboard

Improvements to Null Checks and Device Assignment in LSI and ETM Models

Open XavierSpycy opened this issue 8 months ago • 0 comments

Description

This pull request addresses two main issues found in the models.LSI and models.ETM modules.

Changes Made

  1. 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.
  2. 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.

XavierSpycy avatar Jun 15 '24 08:06 XavierSpycy