{"id":9195,"library":"prodigyopt","title":"ProdigyOpt Optimizer","description":"ProdigyOpt is an Adam-like optimizer for neural networks, designed for high performance and memory efficiency. It features adaptive learning rate estimation and implements decoupled weight decay. The current version is 1.1.2, and releases typically focus on minor bug fixes and performance enhancements.","status":"active","version":"1.1.2","language":"python","source_language":"en","source_url":"https://github.com/konstmish/prodigy","tags":["optimizer","pytorch","machine-learning","deep-learning","neural-networks"],"install":[{"cmd":"pip install prodigyopt","lang":"bash","label":"Install ProdigyOpt"}],"dependencies":[],"imports":[{"wrong":"from prodigyopt import Prodigy","symbol":"Prodigy","correct":"from prodigyopt import Prodigy"}],"quickstart":{"code":"import torch\nimport torch.nn as nn\nfrom prodigyopt import Prodigy\n\n# 1. Define a simple model\nmodel = nn.Linear(10, 2)\n\n# 2. Initialize the optimizer with model parameters\n#    decouple_wd=True is default, but explicitly shown for clarity\noptimizer = Prodigy(model.parameters(), lr=1e-3, decouple_wd=True)\n\n# 3. Define a loss function\nloss_fn = nn.MSELoss()\n\n# 4. Prepare dummy data\ninputs = torch.randn(5, 10)\ntargets = torch.randn(5, 2)\n\n# 5. Perform a training step\noptimizer.zero_grad() # Clear gradients\noutputs = model(inputs) # Forward pass\nloss = loss_fn(outputs, targets) # Compute loss\nloss.backward() # Backward pass to compute gradients\noptimizer.step() # Update model parameters\n\nprint(f\"Loss after one step: {loss.item():.4f}\")","lang":"python","description":"This quickstart demonstrates how to initialize the Prodigy optimizer with a PyTorch model and perform a single optimization step. It includes model definition, loss calculation, and the standard optimizer workflow."},"warnings":[{"fix":"Consider increasing `slice_p` if you encounter OutOfMemory errors with large models. Experiment to find the optimal balance between memory and speed for your specific setup.","message":"The `slice_p` parameter (introduced in v1.1, default 1) can significantly impact memory usage for large models. Higher values (e.g., 4) process parameters in slices, reducing peak memory at the cost of a slight performance overhead.","severity":"gotcha","affected_versions":">=1.1"},{"fix":"If you require coupled weight decay or different regularization behavior, explicitly set `decouple_wd=False` during optimizer initialization: `Prodigy(..., decouple_wd=False)`.","message":"The `decouple_wd` parameter defaults to `True` in Prodigy. This applies weight decay in a decoupled manner, which is generally desired for AdamW-like optimizers but might behave differently from other optimizers if you expect coupled weight decay.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `prodigyopt>=1.1.2` for full compatibility and stability with FSDP setups. Ensure all parameters passed to the optimizer are unfrozen or handled correctly by FSDP.","message":"Versions prior to `1.1.2` had known issues when used with PyTorch's FSDP (Fully Sharded Data Parallel), particularly when some parameters were frozen, leading to incorrect behavior or crashes.","severity":"breaking","affected_versions":"<1.1.2"}],"env_vars":null,"search_vec":"'1.1.2':35 'adam':7 'adam-lik':6 'adapt':22 'bug':42 'current':32 'decay':30 'decoupl':28 'deep':53 'deep-learn':52 'design':13 'effici':19 'enhanc':46 'estim':25 'featur':21 'fix':43 'focus':39 'high':15 'implement':27 'learn':23,51,54 'like':8 'machin':50 'machine-learn':49 'memori':18 'minor':41 'network':12,57 'neural':11,56 'neural-network':55 'optim':2,9,47 'perform':16,45 'prodigyopt':1,3 'pytorch':48 'rate':24 'releas':37 'typic':38 'version':33 'weight':29","created_at":"2026-04-16T18:48:57.374156+00:00","updated_at":"2026-04-16T18:48:57.374156+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmpu4k1wti7/venv/lib/python3.12/site-packages/prodigyopt/__init__.py\", line 1, in <module>\n    from .prodigy import Prodigy\n  File \"/tmp/tmpu4k1wti7/venv/lib/python3.12/site-packages/prodigyopt/prodigy.py\", line 4"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.1.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/konstmish/prodigy","docs":null,"changelog":null,"pypi":"https://pypi.org/project/prodigyopt/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}