Skip to content

Automatic Backend Selection #160

@jeremymanning

Description

@jeremymanning

Parent Epic: #155

Task: Automatic Backend Selection

Description

Implement intelligent backend selection when backend=None, detecting available resources (GPU, Metal, CUDA) and libraries.

Acceptance Criteria

  • Detects GPU/Metal/CUDA availability
  • Checks for JAX/PyTorch installation
  • Selects optimal backend automatically
  • Falls back to NumPy gracefully
  • Clear logging of backend selection

Technical Details

  • Create backend selection logic in htfa/backends/init.py
  • Check for GPU: nvidia-smi, Metal API, ROCm
  • Try importing jax/torch, check versions
  • Implement priority: JAX+GPU > PyTorch+GPU > NumPy
  • Cache detection results for performance

Dependencies

  • Task 159 must be complete (backend interface exists)

Effort Estimate

  • Size: S
  • Hours: 4-6
  • Parallel: false

Definition of Done

  • Detection logic implemented
  • Automatic selection works
  • Fallback mechanisms tested
  • Performance profiling done
  • Documentation updated

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions