Skip to content

Gpu cpu parameter#91

Merged
ocots merged 5 commits intodevelopfrom
gpu_cpu_parameter
Mar 5, 2026
Merged

Gpu cpu parameter#91
ocots merged 5 commits intodevelopfrom
gpu_cpu_parameter

Conversation

@ocots
Copy link
Copy Markdown
Member

@ocots ocots commented Mar 5, 2026

No description provided.

ocots added 5 commits March 5, 2026 18:16
- 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.
@ocots ocots merged commit 5d72730 into develop Mar 5, 2026
7 checks passed
@ocots ocots deleted the gpu_cpu_parameter branch March 5, 2026 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant