|
6 | 6 | using StabilityMatrix.Core.Helper; |
7 | 7 | using StabilityMatrix.Core.Helper.Cache; |
8 | 8 | using StabilityMatrix.Core.Helper.HardwareInfo; |
| 9 | +using StabilityMatrix.Core.Models; |
9 | 10 | using StabilityMatrix.Core.Models.FileInterfaces; |
10 | 11 | using StabilityMatrix.Core.Models.Progress; |
11 | 12 | using StabilityMatrix.Core.Processes; |
@@ -42,6 +43,49 @@ IPyInstallationManager pyInstallationManager |
42 | 43 | + "Visual Studio Build Tools for C++ Desktop Development will be installed automatically. " |
43 | 44 | + "AMD GPUs under the RX 6800 may require additional manual setup."; |
44 | 45 | public override string LaunchCommand => Path.Combine("zluda", "zluda.exe"); |
| 46 | + |
| 47 | + public override List<LaunchOptionDefinition> LaunchOptions |
| 48 | + { |
| 49 | + get |
| 50 | + { |
| 51 | + var options = base.LaunchOptions; |
| 52 | + |
| 53 | + // Update Cross Attention Method default |
| 54 | + var crossAttentionIndex = options.FindIndex(o => o.Name == "Cross Attention Method"); |
| 55 | + if (crossAttentionIndex != -1) |
| 56 | + { |
| 57 | + options[crossAttentionIndex] = options[crossAttentionIndex] with |
| 58 | + { |
| 59 | + InitialValue = "--use-quad-cross-attention" |
| 60 | + }; |
| 61 | + } |
| 62 | + |
| 63 | + // Add new options before Extras (which is usually last) |
| 64 | + var extrasIndex = options.FindIndex(o => o.Name == "Extra Launch Arguments"); |
| 65 | + var insertIndex = extrasIndex != -1 ? extrasIndex : options.Count; |
| 66 | + |
| 67 | + options.Insert(insertIndex, new LaunchOptionDefinition |
| 68 | + { |
| 69 | + Name = "Disable Async Offload", |
| 70 | + Type = LaunchOptionType.Bool, |
| 71 | + InitialValue = true, |
| 72 | + Options = ["--disable-async-offload"], |
| 73 | + Description = "Disable async weight offloading. Recommended for ZLUDA stability.", |
| 74 | + }); |
| 75 | + |
| 76 | + options.Insert(insertIndex + 1, new LaunchOptionDefinition |
| 77 | + { |
| 78 | + Name = "Disable Pinned Memory", |
| 79 | + Type = LaunchOptionType.Bool, |
| 80 | + InitialValue = true, |
| 81 | + Options = ["--disable-pinned-memory"], |
| 82 | + Description = "Disable pinned memory. Recommended for ZLUDA stability.", |
| 83 | + }); |
| 84 | + |
| 85 | + return options; |
| 86 | + } |
| 87 | + } |
| 88 | + |
45 | 89 | public override IEnumerable<TorchIndex> AvailableTorchIndices => [TorchIndex.Zluda]; |
46 | 90 |
|
47 | 91 | public override TorchIndex GetRecommendedTorchVersion() => TorchIndex.Zluda; |
|
0 commit comments