Debug model inference issues for both warehouse and SPCS. Covers dtype errors, nullable signature problems, service failures, OOM, container issues. Use when: inference error, mv.run fails, TypeError, np.radians error, service not starting, OOM, container crash.
This skill helps diagnose and fix inference issues for models deployed via Snowflake Model Registry, whether running on warehouse or SPCS.
Before proceeding, check if you already have the environment guide (from machine-learning/SKILL.md → Step 0) in memory. If you do NOT have it or are unsure, go back and load it now. The guide contains essential surface-specific instructions for session setup, code execution, and package management that you must follow.
Ask user or detect from context:
If the user mentions service_name parameter, REST API, or SPCS compute pool, it's SPCS inference. If they mention MODEL() SQL function or mv.run() without service_name, it's warehouse inference.
If unclear, ask:
Where is your inference running?
1. **Warehouse** - Using `mv.run()` without service_name, or SQL `MODEL()` calls
2. **SPCS Service** - Using `mv.run()` with service_name parameter, or REST API calls to a deployed service
⚠️ STOP: Wait for user response if inference type is not clear from context.
Routing:
Before diagnosing model-level issues, verify the service is healthy and retrieve logs to identify the error:
-- Check service status
DESCRIBE SERVICE <DATABASE>.<SCHEMA>.<SERVICE_NAME>;
-- Get detailed instance status
SELECT SYSTEM$GET_SERVICE_STATUS('<DATABASE>.<SCHEMA>.<SERVICE_NAME>');
-- Get recent logs from model-inference container
CALL SYSTEM$GET_SERVICE_LOGS('<DATABASE>.<SCHEMA>.<SERVICE_NAME>', 0, 'model-inference');
Route based on errors found in logs:
| Error Pattern in Logs | Issue | Go To |
|---|---|---|
TypeError: loop of ufunc does not support argument 0 of type float | Nullable dtype issue | Issue A |
'float' object has no attribute 'radians' | Nullable dtype issue | Issue A |
OOMKilled, memory errors | Out of memory | Issue C |
| Container restart, crash | Container issues | Issue D |
| Service status PENDING/STARTING | Service not ready | Issue B |
Retrieve the model version and inspect function signatures for potential issues:
from snowflake.ml.registry import Registry
reg = Registry(session=session, database_name="<DATABASE>", schema_name="<SCHEMA>")
mv = reg.get_model("<MODEL_NAME>").version("<VERSION>")
# Inspect all functions and their signatures
for func in mv.show_functions():
print(f"\nFunction: {func['name']}")
print(f" Target Method: {func['target_method']}")
print(" Input Features:")
for feat in func['signature'].inputs:
print(f" {feat.name}: dtype={feat._dtype}, nullable={feat._nullable}")
print(" Output Features:")
for feat in func['signature'].outputs:
print(f" {feat.name}: dtype={feat._dtype}, nullable={feat._nullable}")
What to look for:
nullable=True on numeric types (DOUBLE, FLOAT, INT) can cause NumPy ufunc errorsNote: This issue only occurs with SPCS inference, not warehouse inference. The SPCS inference server handles dtype conversion differently.
Errors like:
TypeError: loop of ufunc does not support argument 0 of type float which has no callable radians method