Snakepit.Error.Device (Snakepit v0.8.7)
View SourceDevice error creation helpers.
Provides functions for creating device-related errors with telemetry emission and helpful suggestions.
Summary
Functions
Creates a device mismatch error.
Creates a device unavailable error.
Creates an out of memory error with recovery suggestions.
Functions
@spec device_mismatch(term(), term(), String.t()) :: Snakepit.Error.DeviceMismatch.t()
Creates a device mismatch error.
Examples
error = Device.device_mismatch(:cpu, {:cuda, 0}, "matmul")
@spec out_of_memory(term(), non_neg_integer(), non_neg_integer(), String.t() | nil) :: Snakepit.Error.OutOfMemory.t()
Creates an out of memory error with recovery suggestions.
Examples
error = Device.out_of_memory({:cuda, 0}, 1024 * 1024 * 1024, 512 * 1024 * 1024)