{"record":{"id":"bdcb42192de795a4","repo":"xai-org/x-algorithm","slug":"unknown-optim-optim-r","errorCode":null,"errorMessage":"unknown optim={optim!r}","messagePattern":"unknown optim=(.+?)","errorType":"validation","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"phoenix/xrex/optimizers/optim.py","lineNumber":139,"sourceCode":"    return optax.GradientTransformation(init_empty_state, update_fn)\n\n\n_OPTIM_ALIASES: dict[str, str] = {}\n\n\n@configclass\nclass OptimConfig(Config):\n    optim: str\n    learning_rate: BaseSchedule | float = 1.0\n    b1: float = 0.9\n    b2: float = 0.99\n    weight_decay: float = 0.0\n    clip_by_global_norm: float = 1.0\n\n    def make(self):\n        optim = _OPTIM_ALIASES.get(self.optim, self.optim)\n        if optim not in (\"adam\",):\n            raise NotImplementedError(f\"unknown optim={optim!r}\")\n\n        @inject_hyperparams\n        def schedule_optim(learning_rate, b1, b2, weight_decay):\n            core = optax.adamw(learning_rate, b1=b1, b2=b2, weight_decay=weight_decay)\n            return optax.chain(\n                optax.clip_by_global_norm(self.clip_by_global_norm),\n                core,\n                scale_by_lr_multiplier(),\n            )\n\n        schedule_args = map(_instantiate, (self.learning_rate, self.b1, self.b2, self.weight_decay))\n        return schedule_optim(*schedule_args)\n","sourceCodeStart":121,"sourceCodeEnd":152,"githubUrl":"https://github.com/xai-org/x-algorithm/blob/24c60942c5c5fdad3a6addffb4c6e6d2f228f04f/phoenix/xrex/optimizers/optim.py#L121-L152","documentation":"The Optimizer config's make() resolves the optimizer name through _OPTIM_ALIASES and only accepts (aliases of) 'adam'. Any other name raises NotImplementedError, telling you this entry point currently supports only the AdamW path.","triggerScenarios":"Setting config.optim = 'sgd', 'adafactor', 'lion', etc. and calling make() (typically via _instantiate during trainer construction).","commonSituations":"Porting training configs from other frameworks expecting a string optimizer registry; assuming a generic optimizer enum exists in xrex.","solutions":["Use 'adam' (or an alias present in _OPTIM_ALIASES) since only the AdamW path is implemented","If you need another optimizer, build the optax transformation directly and pass it in instead of using the string config","Add your optimizer to _OPTIM_ALIASES and extend make() with a matching branch"],"exampleFix":"# before\noptim_cfg = OptimizerConfig(optim=\"adafactor\")\n# after\noptim_cfg = OptimizerConfig(optim=\"adam\")","handlingStrategy":"validation","validationCode":"from phoenix.xrex.optimizers.optim import _OPTIM_ALIASES\nassert cfg.optim in _OPTIM_ALIASES or cfg.optim == 'adam', 'only adam supported'","typeGuard":"def is_supported_optim(name: str) -> bool:\n    return _OPTIM_ALIASES.get(name, name) == 'adam'","tryCatchPattern":"try:\n    opt = cfg.make()\nexcept NotImplementedError:\n    opt = my_custom_optax_optimizer()  # fallback","preventionTips":["Restrict optimizer strings in config schemas to supported values","Pin versions and read _OPTIM_ALIASES after upgrades"],"tags":["optimizer","optax","config","not-implemented"],"backgroundTag":"unsupported-option-value","analyzedSha":"24c60942c5c5fdad3a6addffb4c6e6d2f228f04f","analyzedAt":"2026-08-28T11:40:14.686Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}