Merged
Conversation
- Replace isdefined(Main, :CUDA) checks with proper method dispatch
- Add __get_cuda_backend(::Type{<:GPU}) stub in src/Modelers/exa.jl
- Add __consistent_backend() function with default implementation
- Create CTSolversCUDA extension with GPU-specific overrides
- Update Project.toml with CUDA weakdeps and extensions
- Add comprehensive @test_logs tests for consistency warnings
- Use proper dispatch on types (CPU/GPU + backend types)
This resolves the issue where consistency checks failed in tests due to
packages being imported in test modules rather than Main.
- Replace runtime isdefined() checks with Julia multiple dispatch - Add prefixed stub functions: __madnlp_* and __madncl_* - Implement type-specific consistency validators for CPU/GPU combinations - Update CTSolversMadNLPGPU extension with GPU-specific overrides - Add comprehensive tests with @test_logs for warning capture - Include type stability tests with @inferred - Test actual linear solver defaults and validation behavior This completes the refactor of consistency checks for both MadNLP and MadNCL solvers, following the same dispatch-based pattern as Exa modeler.
- Create madnlpsuite.jl with shared __madnlp_suite_* functions - Remove duplicate functions from madnlp.jl and madncl.jl - Eliminate redundant validators in CTSolversMadNCL.jl (inherited from MadNLP) - Simplify CTSolversMadNLPGPU.jl by removing MadNLP/MadNCL duplication - Update all references to use unified __madnlp_suite_* functions - Reduce codebase by ~200 lines while maintaining all functionality - All 34 tests continue to pass with clean dispatch-based validation This creates a much cleaner architecture where MadNCL naturally inherits MadNLP functionality through shared suite functions, eliminating the need for separate prefixed implementations.
- Update test_helpers.jl to import CTSolvers.Solvers - Replace CTSolversMadNLP.__madnlp_suite_* with Solvers.__madnlp_suite_* - Fix all extension helper tests to access functions from correct module - All 9 test_helpers tests now pass (was 3 passed, 2 failed, 3 errored) - All 34 madnlp_gpu_linear_solver tests continue to pass This resolves the UndefVarError issues caused by incorrect module references after the architectural simplification with shared suite functions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.