{"record":{"id":"ec7c1487298986cf","repo":"tracel-ai/burn","slug":"no-fusion-optimization-named-is-registered-r","errorCode":null,"errorMessage":"no fusion optimization named `{}` is registered; register its provider before restoring serialized execution plans","messagePattern":"no fusion optimization named `(.+?)` is registered; register its provider before restoring serialized execution plans","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/burn-cubecl/src/fusion/registry.rs","lineNumber":223,"sourceCode":"/// valid when a built-in is renamed or retired.\n///\n/// # Errors\n///\n/// Fails with [`RegistryError::ServiceRunning`] once the fusion backend\n/// service has started; call this at the start of the program.\npub fn remove(name: &str) -> Result<(), RegistryError> {\n    registry().lock().unwrap().remove(name)\n}\n\n/// Restore the optimization described by `state` through its provider's\n/// [`restore`](OptimizationProvider::restore).\npub(crate) fn restore(device: &CubeDevice, state: CubeOptimizationState) -> CubeOptimization {\n    let registry = registry().lock().unwrap();\n    registry\n        .provider(&state.name)\n        .map(|slot| downcast(slot).restore(device, &state))\n        .unwrap_or_else(|| {\n            panic!(\n                \"no fusion optimization named `{}` is registered; register its \\\n                 provider before restoring serialized execution plans\",\n                state.name,\n            )\n        })\n}\n\n/// The fusers for a new execution stream: one per registered provider — the\n/// built-ins minus the [`remove`]d ones, plus the user-registered ones. Seals\n/// the registry — streams only exist once the fusion service runs, and later\n/// registrations could not apply to the streams already built.\npub(crate) fn fusers(device: &CubeDevice) -> Vec<Box<dyn OperationFuser<CubeOptimization>>> {\n    let mut registry = registry().lock().unwrap();\n    registry\n        .start()\n        .providers\n        .iter()\n        .map(|(_, slot)| downcast(slot).fuser(device).fuser)","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/tracel-ai/burn/blob/d16f7ba2ed0d41408189384044cc886fb4c8f957/crates/burn-cubecl/src/fusion/registry.rs#L205-L241","documentation":"When deserializing a `CubeOptimizationState` (e.g. from a saved model/execution plan), the fusion registry looks up the optimization provider by name. If no provider with that name was registered (providers self-register at startup), restoring fails with this panic.","triggerScenarios":"Calling `restore` (loading serialized fusion state) for an optimization whose provider was never registered in the current process — e.g. the feature providing it isn't enabled, or load happens before registration.","commonSituations":"Loading a checkpoint/model saved with extra burn fusion features into a binary without them; reordering static initialization so deserialization runs before provider registration; version mismatch changing optimization names.","solutions":["Ensure the crate/feature that registers the named fusion provider is enabled (check burn feature flags)","Force provider registration before loading state (touch the relevant module, e.g. a use/registration call at startup)","Re-save the model/plan with the same burn version that will load it"],"exampleFix":"// before\nlet state = load_state(); // provider never registered\nlet opt = restore(&device, state);\n// after\nburn_cubecl::fusion::registry_init(); // ensure providers register\nlet opt = restore(&device, load_state());","handlingStrategy":"try-catch","validationCode":"let registered = burn_cubecl::fusion::registry()\n    .lock().unwrap()\n    .provider(&state.name).is_some();\nif !registered { /* enable feature or skip restore */ }","typeGuard":null,"tryCatchPattern":"// panic-based API; pre-check instead, or isolate the call:\nlet result = std::panic::catch_unwind(|| restore(&device, state.clone()));\nmatch result {\n    Ok(opt) => { /* use opt */ },\n    Err(_) => { /* rebuild optimization from scratch instead of restoring */ }\n}","preventionTips":["Enable the burn features used when the model/plan was saved","Trigger provider registration (import the module) before deserializing","Pin the same burn version for save and load","Fall back to re-optimizing instead of restoring when a name is unknown"],"tags":["fusion","registry","serialization","deserialization"],"backgroundTag":"fusion-provider-not-registered","analyzedSha":"d16f7ba2ed0d41408189384044cc886fb4c8f957","analyzedAt":"2026-09-05T13:19:14.260Z","contentChangedAt":"2026-09-05T13:19:14.260Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}