MiniMax H3 VRAM Policy / VBAR显存预留策略 (Advanced):
The MiniMaxH3VRAMPolicyT8Advanced node is designed to manage VRAM allocation efficiently within the ComfyUI environment, specifically for advanced users who require precise control over memory usage. This node implements a process-global policy that reserves VRAM and manages headroom dynamically, ensuring that memory is allocated optimally for various tasks. It is particularly beneficial for users who need to maintain a balance between memory usage and performance, as it provides a report-only mode by default and can be connected to the Advanced Hybrid Loader to ensure the policy is applied before model loading. This node helps prevent out-of-memory (OOM) errors by planning VRAM usage and providing warnings when certain conditions are met, such as exceeding maximum reserved memory or failing to synchronize dynamic VRAM settings.
MiniMax H3 VRAM Policy / VBAR显存预留策略 (Advanced) Input Parameters:
mode
The mode parameter determines the operational mode of the VRAM policy. It influences how the policy manages VRAM allocation and headroom. The specific modes available are not detailed in the context, but typically, modes could range from aggressive memory saving to performance-oriented settings. The default mode is report-only, meaning it will not make changes unless explicitly connected to a loader.
fixed_total_reserved_gib
This parameter specifies the fixed amount of VRAM, in GiB, that should be reserved globally. It ensures that a certain amount of memory is always available, reducing the risk of OOM errors. The value should be set based on the total VRAM available and the requirements of the tasks being performed.
external_margin_gib
The external_margin_gib parameter sets an additional margin of VRAM, in GiB, to be reserved beyond the fixed total. This margin acts as a buffer to accommodate unexpected memory demands, providing extra headroom to prevent memory allocation failures.
maximum_reserved_gib
This parameter defines the maximum amount of VRAM, in GiB, that can be reserved. It acts as a cap to prevent excessive memory reservation, which could impact system performance or lead to resource contention with other applications.
clean_before_load
A boolean parameter that, when set to true, ensures that all ComfyUI models are unloaded before applying the VRAM policy. This helps in freeing up memory and ensuring that the policy is applied in a clean state, reducing the risk of memory fragmentation.
require_dynamic_vram
This boolean parameter indicates whether dynamic VRAM management is required. When enabled, the policy will attempt to adjust VRAM allocation dynamically based on current usage patterns, providing flexibility and optimizing memory usage.
minimum_current_headroom_mib
Specifies the minimum amount of current headroom, in MiB, that should be maintained. This ensures that there is always a buffer of free memory available, reducing the likelihood of OOM errors during peak usage.
minimum_commit_headroom_gib
Defines the minimum commit headroom, in GiB, that should be maintained. This parameter ensures that there is sufficient memory available for committed tasks, preventing failures due to insufficient resources.
block_when_commit_below_gate
A boolean parameter that, when true, blocks operations if the commit headroom falls below a specified threshold. This prevents tasks from proceeding when there is insufficient memory, reducing the risk of errors.
policy_epoch
An integer parameter representing the policy epoch, which can be used to track changes or updates to the policy over time. It helps in managing different versions of the policy and ensuring consistency across sessions.
MiniMax H3 VRAM Policy / VBAR显存预留策略 (Advanced) Output Parameters:
policy_fingerprint
The policy_fingerprint is a unique identifier for the current VRAM policy configuration. It helps in tracking and verifying the specific settings applied, ensuring consistency and aiding in troubleshooting.
applied
A boolean output indicating whether the VRAM policy has been successfully applied. This provides confirmation that the settings are active and operational.
policy_scope
Describes the scope of the policy, which is global_process_persistent. This means the policy settings are applied globally across the process and persist until changed or the application is restarted.
cleanup_performed
A boolean output that indicates whether a cleanup operation was performed before applying the policy. This helps in understanding the state of the system and whether memory was freed prior to policy application.
target_reserved_gib
The amount of VRAM, in GiB, that is currently reserved as per the policy. This output provides insight into the actual memory allocation and helps in monitoring resource usage.
warnings
A list of warnings generated during the application of the VRAM policy. These warnings provide important information about potential issues, such as exceeding memory limits or synchronization failures, helping users to take corrective actions.
MiniMax H3 VRAM Policy / VBAR显存预留策略 (Advanced) Usage Tips:
- Connect the policy to the Advanced Hybrid Loader to ensure it is applied before model loading, which helps in maintaining optimal memory usage.
- Adjust the
fixed_total_reserved_gibandexternal_margin_gibparameters based on your system's VRAM capacity and the complexity of the tasks to prevent OOM errors. - Enable
require_dynamic_vramfor tasks with fluctuating memory demands to allow the policy to adjust VRAM allocation dynamically.
MiniMax H3 VRAM Policy / VBAR显存预留策略 (Advanced) Common Errors and Solutions:
Generated VRAM Policy pair changed non-treatment workflow controls.
- Explanation: This error occurs when the VRAM policy alters workflow controls that are not part of the treatment, indicating an unintended change in the workflow.
- Solution: Review the policy settings and ensure that only the intended parameters are modified. Revert any unintended changes to maintain the original workflow controls.
Generated VRAM Policy treatment was not detected.
- Explanation: This error indicates that the expected changes from the VRAM policy treatment were not applied or recognized.
- Solution: Verify that the policy is correctly connected and applied. Check the policy settings and ensure that they align with the intended treatment objectives.
