Commit Graph

  • 353a121d03 Alternative to SemaphoreSlim added mlemanczyk 2025-11-30 15:41:00 +01:00
  • c3254e3fda Temporary restored delegating all work to CPU in CPU mode in preparation for a branch-less split. mlemanczyk 2025-11-30 15:40:03 +01:00
  • 67c1d9309a Reusing prime work limiter to limit the number of active threads. mlemanczyk 2025-11-30 15:37:01 +01:00
  • fbfc682899 Restored heuristic prime tester use mlemanczyk 2025-11-30 15:35:56 +01:00
  • 6a1198c417 CPU vs GPU work delegation adjusted to better utilize CPU. mlemanczyk 2025-11-29 12:09:33 +01:00
  • c311b27dcc Prime testing using divisor tables depending on the last digit separated to its own class. PrimeTester switched back to standard endings. mlemanczyk 2025-11-27 16:45:02 +01:00
  • a296e62d4d --min-k command-line argument added. Partial factoring switched back to CPU. mlemanczyk 2025-11-26 22:03:52 +01:00
  • 13498dc460 Most device buffers integrated into PrimeOrderCalculatorAccelerator. PrimeOrderCalculator switched to partial factoring on GPU. mlemanczyk 2025-11-26 03:16:39 +01:00
  • 5b48a89448 Cleanup. Hint removed. mlemanczyk 2025-11-25 01:34:31 +01:00
  • bacb2a1d18 Cleanup. Unnecessary GC collection removed. It doesn't limit RAM usage. mlemanczyk 2025-11-25 01:30:59 +01:00
  • 1e9bd49145 Cleanup. No longer applicable TODO removed. mlemanczyk 2025-11-25 01:30:13 +01:00
  • 47521e327a Cleanup mlemanczyk 2025-11-25 00:50:18 +01:00
  • e8b4c1fc83 Missing return of accelerator added mlemanczyk 2025-11-25 00:34:17 +01:00
  • 3e756b262e Cleanup mlemanczyk 2025-11-25 00:33:54 +01:00
  • e9787f2991 Cleanup. Completed TODO removed. mlemanczyk 2025-11-24 23:53:09 +01:00
  • 91894637af Aggressive inlining added to simple switch methods. mlemanczyk 2025-11-24 22:54:04 +01:00
  • b9ca95bf8c PrimeOrderCalculatorAccelerator.Rent is now created outside of the loops and re-used for all calculations. mlemanczyk 2025-11-24 22:51:53 +01:00
  • 57a50e2a37 Pow2Mod kernel specific methods moved to Pow2MontgomeryKernels. mlemanczyk 2025-11-24 18:04:07 +01:00
  • 070e2a14fd MontgomeryDivisorData converted to a pooled class to limit GC pressure. MontgomeryDivisorDataGpu added for GPU operations. PrimeOrderCalculator kernels precompiled during warmup. mlemanczyk 2025-11-24 15:14:31 +01:00
  • 07efd5d2a1 Accelerator locks removed mlemanczyk 2025-11-23 14:59:29 +01:00
  • 79021108f5 Tiny cleanup mlemanczyk 2025-11-23 14:53:35 +01:00
  • 6d1ff1372e Factoring switched to PrimeTester.IsPrime for the best performance. PrimeOrderCalculator.PartialFactor switched to GPU factorization. Every so often it will send work to GPU instead of CPU. BatchedResources renamed to MersenneNumberDivisorByDivisorAccelerator for consistency and moved to its own file. It now uses array instead of dictionary for lookup free performance. mlemanczyk 2025-11-23 00:07:03 +01:00
  • 7b09c1fd3b Missing accelerator returns to pool added mlemanczyk 2025-11-20 15:57:07 +01:00
  • 497b1fcf89 Kernels replaced with pre-compiled actions for better performance add-hybrid-mode mlemanczyk 2025-11-20 03:00:11 +01:00
  • df04ba601c Various small optimizations and cleanups. Methods made static, where possible. Duplicated & slow PrimeTester.BinaryGcd implementation removed. Optimized version was used instead. mlemanczyk 2025-11-20 01:43:29 +01:00
  • 9939c5d562 Divisor will now be saved to CSV file mlemanczyk 2025-11-19 22:14:28 +01:00
  • 54fdff0a4e GPU calculations frequency adjusted mlemanczyk 2025-11-19 21:38:07 +01:00
  • b031003a46 GPU usage restored to duplicate CL exceptions. codex/analyze-gc-instances-in-checkdivisors-method mlemanczyk 2025-11-19 17:18:19 +01:00
  • 8541bc4928 Test file added mlemanczyk 2025-11-19 16:58:29 +01:00
  • 5cac51479e GPU memory allocations protected with lock to prevent shared memory access issues. GPU usage limited for the best performance. mlemanczyk 2025-11-19 16:49:01 +01:00
  • 02d16bf05c Tiny cleanup mlemanczyk 2025-11-18 06:02:43 +01:00
  • a5696ca17f App crash fix related to unassigned value mlemanczyk 2025-11-18 06:01:58 +01:00
  • 56be12ab95 Cleanup & compilation fixes. mlemanczyk 2025-11-18 04:45:18 +01:00
  • bc51962f9d Cleanup mlemanczyk 2025-11-18 04:37:11 +01:00
  • 801b1be3e3 Cleanup mlemanczyk 2025-11-18 04:22:39 +01:00
  • 66ca969929 Naming improvements and small cleanup mlemanczyk 2025-11-18 03:43:52 +01:00
  • bf7c4bab39 Accelerator buffers integrated mlemanczyk 2025-11-18 01:13:12 +01:00
  • 342eff2726 GpuKernelPool.GetOrAddKernels removed in --mersenne=bydivisor mode. PartialFactorResult.WithAdditionalPrime will now modify the current instance instead of creating new copy for better performance. SmallPrimeFactorViews renamed to SmallPrimeFactorGpuTables for consistency with other static tables. mlemanczyk 2025-11-17 23:33:59 +01:00
  • 2fc74cf98d Cleanup mlemanczyk 2025-11-17 20:12:00 +01:00
  • f630bfb598 HeuristicCombinedPrimeTesterAccelerator integrated with PrimeOrderCalculatorAccelerator. mlemanczyk 2025-11-17 17:38:23 +01:00
  • 183b147135 Heuristic tables split into 2 groups mlemanczyk 2025-11-17 16:04:27 +01:00
  • c413ee1162 Revert "Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes." mlemanczyk 2025-11-16 17:14:48 +01:00
  • a84445ef2a Stream handling simplified to avoid dictionary lookups in favor of array lookups with known indexes. mlemanczyk 2025-11-16 15:01:51 +01:00
  • cd7636ddbe Manual accelerator stream creations replaced with pool mlemanczyk 2025-11-15 13:45:24 +01:00
  • 0540411cad Accelerator index added for dictionary-less use-cases mlemanczyk 2025-11-15 02:21:45 +01:00
  • 6cb63b6e73 Internal accelerator array removed mlemanczyk 2025-11-14 12:03:31 +01:00
  • 42447c4e43 BinaryGcd switched to the best performing variant according to benchmarks. mlemanczyk 2025-11-14 11:43:16 +01:00
  • be435b7760 Kernels made part of the accelerators for better performance. mlemanczyk 2025-11-13 18:52:46 +01:00
  • 0d2a88c45f GpuPrimeWorkLimiter.Acquire() / .Release() removed to save time on the hot-path with billions of calls. We'll rely on AcceleratorStreamPool limits and synchronization. mlemanczyk 2025-11-13 17:52:13 +01:00
  • 1552e10ff0 VS Code settings updated. mlemanczyk 2025-11-13 15:42:09 +01:00
  • c53aa517f7 GpuScratchBuffer / -Pool naively integrated with PriemOrderCalculatorAccelerator (formerly Pow2MontgomeryAccelerator). FactorEntry replaced with 2 arrays - unused field removed. Small cleanup. mlemanczyk 2025-11-13 14:41:27 +01:00
  • 43863d03fb Performance improvements mlemanczyk 2025-11-13 00:51:32 +01:00
  • 5bc65464d0 Initial PollardRho implementation for GPU. Added pool for accelerator streams shared across the threads. GPU processing performance and stabilization improvements. GpuUInt128.BinaryGcd switched to the version which outperformed other in benchmarks. mlemanczyk 2025-11-12 21:18:30 +01:00
  • 735bfa1557 GPU accelerator recycled for better performance. mlemanczyk 2025-11-12 07:39:52 +01:00
  • fdc2da7dae Accelerator leak fixed. mlemanczyk 2025-11-11 16:40:44 +01:00
  • cf5f78c2ef PrimeTesterByLastDigitAccelerator integrated into Pow2MontgomeryGpuCalculator for better performance. mlemanczyk 2025-11-11 13:36:21 +01:00
  • 0de9871529 Functionality and classes separated. Kernel initialization made dependent on a flag. Cleanup. mlemanczyk 2025-11-10 18:35:50 +01:00
  • 45dfa3b724 Console logging extended with kernel warmup progress mlemanczyk 2025-11-10 18:18:12 +01:00
  • fa89958736 Stabilization improvements. Stream will be released when releasing GPU lease to prevent application crashes. mlemanczyk 2025-11-10 14:30:30 +01:00
  • 2726c369f6 Merge pull request #256 from mlemanczyk/codex/optimize-evenperfectbitscanner-for-static-arrays Marek Lemańczyk 2025-11-09 21:53:50 +01:00
  • d0b1639a5d GPU stabilization improvements to prevent calculation crashes mlemanczyk 2025-11-09 21:52:16 +01:00
  • a338bb0d0b Merge branch 'codex/optimize-evenperfectbitscanner-for-static-arrays' of https://github.com/mlemanczyk/even-perfect-numbers-scanner into codex/optimize-evenperfectbitscanner-for-static-arrays mlemanczyk 2025-11-07 15:39:11 +01:00
  • 8e779c5c9e GpuKernelLease removed mlemanczyk 2025-11-07 15:18:17 +01:00
  • da3093a9ba GpuKernelLease removed mlemanczyk 2025-11-07 15:18:17 +01:00
  • 0410fd2c91 PooledContext removal - continuation. GpuKernelLease prepared for removal. mlemanczyk 2025-11-07 14:13:11 +01:00
  • f4e365194d GpuContextPool removed, because we share context and accelerator between threads, using streams to separate. mlemanczyk 2025-11-07 12:52:20 +01:00
  • 7c035239b4 Cleanup. Classes & structs extracted to their own files. mlemanczyk 2025-11-07 10:34:31 +01:00
  • 119690086a ConcurrentDictionary removed. Kernel made dependent on the shared GPU context. mlemanczyk 2025-11-07 10:16:33 +01:00
  • 9537addf38 ArrayPool<T> replaced with ThreadStaticPools mlemanczyk 2025-11-07 00:46:16 +01:00
  • c004e140db Ignore words extended mlemanczyk 2025-11-06 18:54:18 +01:00
  • de2a78b27b Streams added to all kernels and GPU operations to separate threads from each other. mlemanczyk 2025-11-06 18:53:55 +01:00
  • 64d615c402 Various optimizations to separate non-static data between threads and resolve read/write access issue. mlemanczyk 2025-11-04 20:38:59 +01:00
  • 5a17fa64d5 Restore per-lease kernel containers Marek Lemańczyk 2025-11-04 00:46:59 +01:00
  • dbde6337ea Tie GPU scratch buffers to context leases Marek Lemańczyk 2025-11-04 00:26:38 +01:00
  • 4c4d4243fb Merge remote-tracking branch 'github/codex/optimize-evenperfectbitscanner-for-static-arrays-khd9w8' into work Marek Lemańczyk 2025-11-03 23:59:12 +01:00
  • fc22c01ec8 Various improvements to make sure scratch buffers don't override each others memory codex/optimize-evenperfectbitscanner-for-static-arrays-khd9w8 mlemanczyk 2025-11-03 23:49:55 +01:00
  • dcda4b5cba Merge branch 'codex/optimize-evenperfectbitscanner-for-static-arrays' from github Marek Lemańczyk 2025-11-03 18:39:00 +01:00
  • 507daaddb9 Merge pull request #253 from mlemanczyk/codex/optimize-evenperfectbitscanner-for-primetestergpucontextleas Marek Lemańczyk 2025-11-02 14:02:42 +01:00
  • 1cbe7bf869 Use GpuPrimeWorkLimiter for GPU lease limiting Marek Lemańczyk 2025-11-02 14:02:15 +01:00
  • 00d4e9bde2 Add GPU lease warm-up and shared limiter Marek Lemańczyk 2025-11-02 13:47:57 +01:00
  • 0e7bbae132 GPU contexts and accelerators made shared to prevent application crashes with high no. of threads. mlemanczyk 2025-11-02 12:51:31 +01:00
  • b33a3c8e75 Compilation error fixed mlemanczyk 2025-11-02 11:25:41 +01:00
  • 07be671726 Various small optimizations mlemanczyk 2025-11-01 03:42:36 +01:00
  • 76dfe108a9 Address feedback on GPU pooling and heuristic factoring Marek Lemańczyk 2025-10-31 21:47:42 +01:00
  • 5339c3c304 Use span growth instead of dictionaries in partial factor Marek Lemańczyk 2025-10-31 18:52:00 +01:00
  • ab6a416de2 Warm GPU resources before thread startup Marek Lemańczyk 2025-10-31 16:56:25 +01:00
  • 2281d9535e Revert "Merge pull request #251 from mlemanczyk/codex/refactor-prime-checking-on-gpu-n5t2pm" mlemanczyk 2025-11-02 11:22:14 +01:00
  • 6027a73839 Split GPU heuristic tables by scope codex/wprowadz-pule-kontekstow-dla-ostatniej-cyfry Marek Lemańczyk 2025-11-01 09:22:44 +01:00
  • 936ce239db Merge pull request #251 from mlemanczyk/codex/refactor-prime-checking-on-gpu-n5t2pm Marek Lemańczyk 2025-11-01 04:09:00 +01:00
  • 22f20bfe98 Various small optimizations mlemanczyk 2025-11-01 03:42:36 +01:00
  • b7c34f4960 Preload divisor generator tables for GPU pool contexts Marek Lemańczyk 2025-10-31 23:01:28 +01:00
  • 469c8057d3 Flatten heuristic trial division bounds checks Marek Lemańczyk 2025-10-31 22:45:59 +01:00
  • 8c662c5c85 Address feedback on GPU pooling and heuristic factoring Marek Lemańczyk 2025-10-31 21:47:42 +01:00
  • 567b92792c Use span growth instead of dictionaries in partial factor Marek Lemańczyk 2025-10-31 18:52:00 +01:00
  • 6864b316d5 Warm GPU resources before thread startup Marek Lemańczyk 2025-10-31 16:56:25 +01:00
  • e14b77e504 Batch size made dynamic - dependent on the value mlemanczyk 2025-10-30 02:43:15 +01:00
  • 30af16a4f6 Merge pull request #249 from mlemanczyk/codex/optimize-heuristiccombinedprimetester-calculations Marek Lemańczyk 2025-10-29 22:31:52 +01:00
  • fc5700f82c IsPrime with cancellation token removed. mlemanczyk 2025-10-29 22:31:28 +01:00
  • f9504a6a19 Use atomic flag writes in heuristic trial division Marek Lemańczyk 2025-10-29 20:40:40 +01:00
  • 5ac05489c1 Use precomputed divisor squares in heuristic prime tester Marek Lemańczyk 2025-10-29 20:22:41 +01:00