Dala.ML.Debug (dala v0.3.0)

Copy Markdown View Source

ML debugging and profiling tools for Dala apps.

Provides tensor inspection, model profiling, and performance overlays for development and debugging.

Usage

# Inspect a tensor
Dala.ML.Debug.tensor_info(my_tensor)
# %{shape: {1, 224, 224, 3}, type: {:f, 32}, min: 0.0, max: 255.0, mean: 127.5}

# Profile inference
Dala.ML.Debug.profile(model, params, input, iterations: 100)
# %{avg_ms: 12.3, min_ms: 10.1, max_ms: 15.2, p95_ms: 14.1}

# Print model summary
Dala.ML.Debug.model_summary(model)

Summary

Functions

Compares outputs from two backends for consistency checking. Useful for validating CoreML vs ONNX vs Nx produce the same results.

Returns the current ML environment info for bug reports.

Prints a summary of the model architecture.

Profiles inference latency over multiple iterations.

Returns a map of tensor metadata for debugging.

Functions

compare_outputs(output_a, output_b, opts \\ [])

@spec compare_outputs(Nx.Tensor.t(), Nx.Tensor.t(), keyword()) :: map()

Compares outputs from two backends for consistency checking. Useful for validating CoreML vs ONNX vs Nx produce the same results.

environment_info()

@spec environment_info() :: map()

Returns the current ML environment info for bug reports.

model_summary(model)

@spec model_summary(term()) :: :ok

Prints a summary of the model architecture.

profile(model, params, input, opts \\ [])

@spec profile(term(), term(), term(), keyword()) :: map()

Profiles inference latency over multiple iterations.

Returns timing statistics in milliseconds.

tensor_info(tensor)

@spec tensor_info(Nx.Tensor.t()) :: map()

Returns a map of tensor metadata for debugging.