Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize sparse condensed Hessian kernels on GPU #399

Open
amontoison opened this issue Jan 10, 2025 · 13 comments
Open

Optimize sparse condensed Hessian kernels on GPU #399

amontoison opened this issue Jan 10, 2025 · 13 comments

Comments

@amontoison
Copy link
Member

julia> CUDA.@profile madnlp(exa2; tol=tol)

EXIT: Optimal Solution Found (tol = 1.0e-07).
Profiler ran for 18.03 s, capturing 1527254 events.

Host-side activity: calling CUDA APIs took 1.8 s (10.00% of the trace)
┌──────────┬────────────┬───────┬─────────────────────────────────────────┬────────────────────────────────────────────────────────┐
│ Time (%) │ Total time │ Calls │ Time distribution                       │ Name                                                   │
├──────────┼────────────┼───────┼─────────────────────────────────────────┼────────────────────────────────────────────────────────┤
│   34.35% │      6.2 s │  7942 │ 780.08 µs ± 6403.01 (  0.48 ‥ 63485.38) │ cuStreamSynchronize                                    │
│    3.84% │  691.74 ms │   541 │   1.28 ms ± 17.79  (  0.01 ‥ 361.13)    │ cudaMemcpyAsync                                        │
│    0.83% │   149.6 ms │     2 │   74.8 ms ± 105.52 (  0.19 ‥ 149.42)    │ cudaFree                                               │
│    0.39% │   70.94 ms │ 13602 │   5.22 µs ± 1.28   (  3.34 ‥ 42.44)     │ cuLaunchKernel                                         │
│    0.18% │   32.92 ms │  2383 │  13.82 µs ± 1.56   ( 11.68 ‥ 31.47)     │ cuMemcpyDtoHAsync                                      │
│    0.18% │   32.88 ms │  6874 │   4.78 µs ± 1.31   (  3.58 ‥ 62.47)     │ cudaLaunchKernel                                       │
│    0.18% │   32.67 ms │  6696 │   4.88 µs ± 24.32  (  1.19 ‥ 608.44)    │ cuMemAllocFromPoolAsync                                │
│    0.10% │   17.59 ms │    58 │ 303.23 µs ± 366.74 ( 226.5 ‥ 3020.52)   │ cuMemcpyHtoDAsync                                      │
│    0.05% │    8.34 ms │   727 │  11.48 µs ± 1.9    (  8.11 ‥ 35.76)     │ cuMemcpyDtoDAsync                                      │
│    0.03% │    5.12 ms │   945 │   5.42 µs ± 2.45   (  2.38 ‥ 42.68)     │ cudaMemsetAsync                                        │
│    0.02% │    3.58 ms │  1508 │   2.37 µs ± 0.58   (  1.43 ‥ 8.34)      │ cuMemFreeAsync                                         │
│    0.01% │    1.78 ms │     8 │ 221.94 µs ± 106.48 ( 27.18 ‥ 408.17)    │ cudaMalloc                                             │
│    0.00% │  267.03 µs │  1564 │ 170.73 ns ± 187.04 (   0.0 ‥ 2145.77)   │ cudaGetLastError                                       │
│    0.00% │  209.09 µs │  1454 │ 143.81 ns ± 144.0  (   0.0 ‥ 715.26)    │ cuCtxPushCurrent                                       │
│    0.00% │  188.35 µs │    74 │   2.55 µs ± 0.59   (  1.91 ‥ 6.68)      │ cudaStreamSynchronize                                  │
│    0.00% │  179.77 µs │  1454 │ 123.64 ns ± 136.6  (   0.0 ‥ 476.84)    │ cuCtxPopCurrent                                        │
│    0.00% │  142.81 µs │  1454 │  98.22 ns ± 130.94 (   0.0 ‥ 476.84)    │ cuCtxGetDevice                                         │
│    0.00% │  128.03 µs │  1462 │  87.57 ns ± 128.1  (   0.0 ‥ 476.84)    │ cuDeviceGet                                            │
│    0.00% │   70.81 µs │     1 │                                         │ cuMemGetInfo                                           │
│    0.00% │   28.37 µs │     3 │   9.46 µs ± 5.6    (  3.81 ‥ 15.02)     │ cuMemsetD32Async                                       │
│    0.00% │    9.06 µs │     6 │   1.51 µs ± 0.73   (  0.72 ‥ 2.62)      │ cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags │
│    0.00% │    1.91 µs │     1 │                                         │ cudaGetDevice                                          │
│    0.00% │    1.19 µs │     3 │ 397.36 ns ± 275.3  (238.42 ‥ 715.26)    │ cudaDeviceGetAttribute                                 │
│    0.00% │  715.26 ns │     2 │ 357.63 ns ± 168.59 (238.42 ‥ 476.84)    │ cuMemPoolGetAttribute                                  │
│    0.00% │  476.84 ns │     9 │  52.98 ns ± 105.13 (   0.0 ‥ 238.42)    │ cuDeviceGetCount                                       │
└──────────┴────────────┴───────┴─────────────────────────────────────────┴────────────────────────────────────────────────────────┘

Device-side activity: GPU was busy for 10.16 s (56.33% of the trace)
┌──────────┬────────────┬───────┬────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ Time (%) │ Total time │ Calls │ Time distribution                      │ Name                                                                                                                                                                                                                                                                                                    ⋯
├──────────┼────────────┼───────┼────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│   28.57% │     5.15 s │    68 │  75.76 ms ± 0.16   ( 75.43 ‥ 76.13)    │ gpu__transfer_jtsj_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Float64, 1l, 1l>, Tuple<OneTo<Int64 ⋯
│   15.40% │     2.78 s │   111 │  25.01 ms ± 25.31  (  0.04 ‥ 50.71)    │ gpu__transfer_to_csc_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Float64, 1l, 1l>, Tuple<OneTo<Int ⋯
│    1.89% │  340.67 ms │    68 │   5.01 ms ± 0.03   (  4.96 ‥ 5.18)     │ void cudss::factorize_ker<long, double, int, double, 32, 1, 0, 0, 1, 0, 0, 0, 1>(int, int, int, double*, double*, long const*, int const*, int const*, int*, int const*, long const*, long const*, long const*, int const*, int const*, int*, int const*, int, int, int, int, int, int*, int*, int*, do ⋯
│    1.02% │  184.76 ms │   728 │ 253.79 µs ± 157.24 ( 18.12 ‥ 380.52)   │ void cusparse::csrmv_v3_transpose_kernel<int, int, double, double, double, double, void>(cusparse::KernelCoeffs<double>, int const*, int const*, int const*, double const*, int, int, int, double const*, double*)                                                                                      ⋯
│    1.02% │  184.57 ms │     2 │  92.29 ms ± 129.26 (  0.89 ‥ 183.69)   │ void cudss::radix_sort_ker<int, int, 1, 20, 4, 0>(int, int const*, int*, int*, int*, int*, int, int)                                                                                                                                                                                                    ⋯
│    0.97% │  175.16 ms │    68 │   2.58 ms ± 0.0    (  2.56 ‥ 2.59)     │ void cudss::factorize_v3_ker<long, double, int, double, 256, 1, 0, 0, 1, 1, 0, 0, 4>(int, int, int, int, double*, double*, long const*, int const*, int const*, int*, int const*, long const*, long const*, long const*, int*, int const*, int*, int const*, int, int, int, int, int, int*, int*, int*, ⋯
│    0.82% │  148.62 ms │     1 │                                        │ void cudss::radix_sort_ker<long, int, 1, 20, 4, 1>(int, long const*, int*, int*, int*, int*, int, int)                                                                                                                                                                                                  ⋯
│    0.80% │  144.78 ms │   224 │ 646.33 µs ± 0.7    (644.68 ‥ 648.26)   │ void cudss::bwd_v2_ker<long, double, int, 32, 16, 1, 0, 0>(int const*, int const*, int, int, double*, double*, int const*, long const*, long const*, long const*, int const*, double*, long const*, int const*, int const*, long const*, int const*, int const*, int*, int, int, int, int const*, int,  ⋯
│    0.77% │  138.94 ms │     1 │                                        │ void cudss::map_ker<long, int, int, 128, 1, 2>(int, int const*, int const*, int const*, int const*, int const*, int const*, long const*, long const*, long const*, int const*, int const*, int const*, int*, int const*, int, int*, int*, long*, long*, int, int, int)                                  ⋯
│    0.72% │  130.68 ms │   224 │ 583.41 µs ± 2.69   (577.93 ‥ 592.47)   │ void cudss::bwd_ker<long, double, int, 128, 128, 16, 8, 8, 1, 0, 1, 0>(int const*, int const*, int, int, double*, double*, int const*, long const*, long const*, long const*, int const*, double*, long const*, int const*, int const*, long const*, int const*, int const*, int*, int, int, int, int c ⋯
│    0.68% │  122.04 ms │     1 │                                        │ void cudss::nnz_per_col_ker<int, int, 1, 0>(int, int const*, int const*, int const*, int const*, int*, int*, int*, int*, int, int, int)                                                                                                                                                                 ⋯
│    0.62% │  111.69 ms │   224 │ 498.62 µs ± 1.93   (493.29 ‥ 503.54)   │ void cudss::fwd_v2_ker<long, double, int, 32, 1, 0, 0, 32, 1>(int const*, int const*, int, int, double*, int const*, long const*, long const*, int const*, double*, long const*, int const*, int const*, long const*, int const*, int*, int, int, int, int const*, int, int, int, int, int)             ⋯
│    0.57% │  103.17 ms │     1 │                                        │ void cudss::trans_columns_ker<int, 2, 128>(int, int const*, int const*, int*, int*, int)                                                                                                                                                                                                                ⋯
│    0.20% │   35.68 ms │     1 │                                        │ void cudss::trans_nnz_per_row_ker<int, 2, 128>(int, int const*, int const*, int*, int)                                                                                                                                                                                                                  ⋯
│    0.15% │    26.7 ms │     2 │  13.35 ms ± 18.84  (  0.03 ‥ 26.67)    │ gpu__set_coo_to_csc_map_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Int64, 1l, 1l>, Tuple<OneTo<In ⋯
│    0.14% │   25.71 ms │   224 │  114.8 µs ± 2.2    (112.06 ‥ 121.36)   │ void cudss::fwd_v2_ker<long, double, int, 256, 1, 0, 0, 256, 1>(int const*, int const*, int, int, double*, int const*, long const*, long const*, int const*, double*, long const*, int const*, int const*, long const*, int const*, int*, int, int, int, int const*, int, int, int, int, int)           ⋯
│    0.12% │   22.15 ms │     1 │                                        │ void cudss::adjncy_ker<int, int, 128, 2>(int, int const*, int const*, int*, int*, int*, int*, int)                                                                                                                                                                                                      ⋯
│    0.09% │   15.88 ms │    61 │ 260.38 µs ± 347.4  (  1.43 ‥ 2901.55)  │ [copy pageable to device memory]                                                                                                                                                                                                                                                                        ⋯
│    0.08% │   14.51 ms │  1400 │  10.37 µs ± 1.97   (  5.96 ‥ 12.87)    │ void cusparse::csrmv_v3_partition_kernel<std::integral_constant<bool, false>, 256, int, int, double, double, double>(int const*, int, int, int, int*)                                                                                                                                                   ⋯
│    0.08% │   14.43 ms │     1 │                                        │ void cudss::map_offsets_ker<long, int, int, 128, 1>(int, int const*, int const*, int const*, int const*, int const*, int const*, long const*, long const*, int const*, int const*, int const*, int*, int*, int, int, int, int)                                                                          ⋯
│    0.07% │   13.36 ms │    23 │ 580.73 µs ± 72.43  (398.64 ‥ 680.45)   │ comparator_small_kernel(Tuple<CuDeviceArray<Tuple<Int64, Int64>, 1l, 1l>, CuDeviceArray<Int64, 1l, 1l>>, Int32, Tuple<Int64, Int64>, Tuple<Int64, Int64>, Tuple<Int64, Int64>, _45, isless, Val<false>, Tuple<CuDeviceArray<Tuple<Int64, Int64>, 1l, 1l>, CuDeviceArray<Int64, 1l, 1l>><1l>)            ⋯
│    0.07% │   13.18 ms │  1185 │  11.13 µs ± 7.12   (  5.25 ‥ 24.56)    │ [copy device to device memory]                                                                                                                                                                                                                                                                          ⋯
│    0.07% │   12.84 ms │   105 │ 122.26 µs ± 23.37  ( 58.41 ‥ 170.47)   │ comparator_kernel(Tuple<CuDeviceArray<Tuple<Int64, Int64>, 1l, 1l>, CuDeviceArray<Int64, 1l, 1l>>, Int32, Tuple<Int64, Int64>, Tuple<Int64, Int64>, _45, isless, Val<false>, Tuple<CuDeviceArray<Tuple<Int64, Int64>, 1l, 1l>, CuDeviceArray<Int64, 1l, 1l>><1l>)                                       ⋯
│    0.07% │   11.76 ms │   672 │  17.49 µs ± 3.3    (  12.4 ‥ 21.22)    │ void cusparse::csrmv_v3_kernel<std::integral_constant<bool, false>, int, int, double, double, double, double, void>(cusparse::KernelCoeffs<double>, int const*, int const*, int const*, double const*, int, int, int, double const*, double*, int*, double*)                                            ⋯
│    0.06% │   11.09 ms │    10 │   1.11 ms ± 3.2    (   0.0 ‥ 10.18)    │ void cudss::dependency_map_ker<int, int, 32>(int, int const*, int const*, int const*, int const*, int*, int*, int const*)                                                                                                                                                                               ⋯
@sshin23
Copy link
Member

sshin23 commented Jan 10, 2025

could you also post the problem script as well?

@amontoison
Copy link
Member Author

Yes, it's the content of this file with N=50000.

@amontoison
Copy link
Member Author

amontoison commented Jan 11, 2025

@jbcaillau, do you have a dense row in the Jacobian of the constraint in your goddard problem?
We solve KKT systems with J'J on GPU with MadNLP and I'm wondering if we just don't form a dense matrix.

@jbcaillau
Copy link

@amontoison what to think of the first two calls gpu__transfer... below, more consuming than CUDSS linear algebra?

julia> CUDA.@profile madnlp(exa2; tol=tol)

EXIT: Optimal Solution Found (tol = 1.0e-07).
Profiler ran for 18.03 s, capturing 1527254 events.
[...]

Device-side activity: GPU was busy for 10.16 s (56.33% of the trace)
┌──────────┬────────────┬───────┬────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ Time (%) │ Total time │ Calls │ Time distribution                      │ Name                                                                                                                                                                                                                                                                                                    ⋯
├──────────┼────────────┼───────┼────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│   28.57% │     5.15 s │    68 │  75.76 ms ± 0.16   ( 75.43 ‥ 76.13)    │ gpu__transfer_jtsj_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Float64, 1l, 1l>, Tuple<OneTo<Int64 ⋯
│   15.40% │     2.78 s │   111 │  25.01 ms ± 25.31  (  0.04 ‥ 50.71)    │ gpu__transfer_to_csc_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Float64, 1l, 1l>, Tuple<OneTo<Int ⋯
│    1.89% │  340.67 ms │    68 │   5.01 ms ± 0.03   (  4.96 ‥ 5.18)     │ void cudss::factorize_ker<long, double, int, double, 32, 1, 0, 0, 1, 0, 0, 0, 1>(int, int, int, double*, double*, long const*, int const*, int const*, int*, int const*, long const*, long const*, long const*, int const*, int const*, int*, int const*, int, int, int, int, int, int*, int*, int*, do ⋯
│    1.02% │  184.76 ms │   728 │ 253.79 µs ± 157.24 ( 18.12 ‥ 380.52)   │ void cusparse::csrmv_v3_transpose_kernel<int, int, double, double, double, double, void>(cusparse::KernelCoeffs<double>, int const*, int const*, int const*, double const*, int, int, int, double const*, double*)                                                                                      ⋯

@jbcaillau
Copy link

@amontoison as should be clear from the constraint structure in goddard-exa2.jl, each Jacobian row should be very sparse. a typical constraint involves, at line i, x[i], x[i+1], u[i], u[i+1].

I am also writing a pure ADNLPModels version on which it will be easy to check the sparsity structure.

@jbcaillau, do you have a dense row in the Jacobian of the constraint in your goddard problem? We solve KKT systems with J'J on GPU with MadNLP and I'm wondering if we just don't form a dense matrix.

@sshin23
Copy link
Member

sshin23 commented Jan 11, 2025

It might be good to check (1) global scope variable is causing performance issue and (2) CUDA.@Profile itself is causing something. In my experience this type of problem the bottleneck is the symbolic factorization. I don't see anything in the problem that may cause performance bottleneck

@amontoison
Copy link
Member Author

amontoison commented Jan 11, 2025

@amontoison what to think of the first two calls gpu__transfer... below, more consuming than CUDSS linear algebra?

julia> CUDA.@profile madnlp(exa2; tol=tol)

EXIT: Optimal Solution Found (tol = 1.0e-07).
Profiler ran for 18.03 s, capturing 1527254 events.
[...]

Device-side activity: GPU was busy for 10.16 s (56.33% of the trace)
┌──────────┬────────────┬───────┬────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ Time (%) │ Total time │ Calls │ Time distribution                      │ Name                                                                                                                                                                                                                                                                                                    ⋯
├──────────┼────────────┼───────┼────────────────────────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│   28.57% │     5.15 s │    68 │  75.76 ms ± 0.16   ( 75.43 ‥ 76.13)    │ gpu__transfer_jtsj_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Float64, 1l, 1l>, Tuple<OneTo<Int64 ⋯
│   15.40% │     2.78 s │   111 │  25.01 ms ± 25.31  (  0.04 ‥ 50.71)    │ gpu__transfer_to_csc_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, DynamicSize, DynamicSize, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>>>, CuDeviceArray<Float64, 1l, 1l>, Tuple<OneTo<Int ⋯
│    1.89% │  340.67 ms │    68 │   5.01 ms ± 0.03   (  4.96 ‥ 5.18)     │ void cudss::factorize_ker<long, double, int, double, 32, 1, 0, 0, 1, 0, 0, 0, 1>(int, int, int, double*, double*, long const*, int const*, int const*, int*, int const*, long const*, long const*, long const*, int const*, int const*, int*, int const*, int, int, int, int, int, int*, int*, int*, do ⋯
│    1.02% │  184.76 ms │   728 │ 253.79 µs ± 157.24 ( 18.12 ‥ 380.52)   │ void cusparse::csrmv_v3_transpose_kernel<int, int, double, double, double, double, void>(cusparse::KernelCoeffs<double>, int const*, int const*, int const*, double const*, int, int, int, double const*, double*)                                                                                      ⋯

It means that these two kernels in MadNLP.jl are not effficient and should be improved (if not related to global scope)
It's on my TODO list.

@jbcaillau
Copy link

jbcaillau commented Jan 11, 2025

@sshin23 @amontoison regarding point (1) below, I have changed variables from the global scope to constants in goddard-exa.jl so there should not be any issue on this side. below is the new run, still with N = 50_000.

It might be good to check (1) global scope variable is causing performance issue and (2) CUDA.@Profile itself is causing something. In my experience this type of problem the bottleneck is the symbolic factorization. I don't see anything in the problem that may cause performance bottleneck

julia> CUDA.@profile madnlp(exa2; tol=tol)
This is MadNLP version v0.8.5, running with cuDSS v0.4.0

Number of nonzeros in constraint Jacobian............:  1350017
Number of nonzeros in Lagrangian Hessian.............:  1300008

Total number of variables............................:   350008
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:   300007
Total number of inequality constraints...............:   150004
        inequality constraints with only lower bounds:    50002
   inequality constraints with lower and upper bounds:   100002
        inequality constraints with only upper bounds:        0

[...]

Number of Iterations....: 55

                                   (scaled)                 (unscaled)
Objective...............:  -1.0264249724384082e+00   -1.0264249724384082e+00
Dual infeasibility......:   9.1620584206984594e-13    9.1620584206984594e-13
Constraint violation....:   8.1824980736335345e-10    8.1824980736335345e-10
Complementarity.........:   9.0909098505047791e-09    9.0909098505047791e-09
Overall NLP error.......:   9.0909098505047791e-09    9.0909098505047791e-09

Number of objective function evaluations             = 56
Number of objective gradient evaluations             = 56
Number of constraint evaluations                     = 56
Number of constraint Jacobian evaluations            = 56
Number of Lagrangian Hessian evaluations             = 55
Total wall-clock secs in solver (w/o fun. eval./lin. alg.)  = 11.129
Total wall-clock secs in linear solver                      =  1.444
Total wall-clock secs in NLP function evaluations           =  0.231
Total wall-clock secs                                       = 12.803

EXIT: Optimal Solution Found (tol = 1.0e-07).
Profiler ran for 12.8 s, capturing 1265706 events.

Host-side activity: calling CUDA APIs took 2.39 s (18.69% of the trace)
┌──────────┬────────────┬───────┬───────────────────────────────────────┬────────────────────────────────────────────────────────┐
│ Time (%) │ Total time │ Calls │ Time distribution                     │ Name                                                   │
├──────────┼────────────┼───────┼───────────────────────────────────────┼────────────────────────────────────────────────────────┤
│   66.94%8.57 s │  74791.15 ms ± 8.37   (   0.076.55)   │ cuStreamSynchronize                                    │
│    5.79%741.08 ms │   3861.92 ms ± 22.82  (  0.01401.2)   │ cudaMemcpyAsync                                        │
│    1.14%146.36 ms │    1410.45 ms ± 38.78  (  0.02145.19)  │ cudaFree                                               │
│    1.05%134.48 ms │ 1220611.02 µs ± 15.52  (  2.861585.01) │ cuLaunchKernel                                         │
│    0.53%68.31 ms │    631.08 ms ± 1.04   (  0.718.08)    │ cuMemcpyHtoDAsync                                      │
│    0.43%54.86 ms │  471411.64 µs ± 5.37   (  3.5857.46)   │ cudaLaunchKernel                                       │
│    0.39%49.56 ms │  59308.36 µs ± 20.97  (  1.191075.74) │ cuMemAllocFromPoolAsync                                │
│    0.31%39.88 ms │  222817.9 µs ± 6.56   ( 10.7370.1)    │ cuMemcpyDtoHAsync                                      │
│    0.24%30.21 ms │ 102632.94 µs ± 1.94   (  1.4341.96)   │ cuMemFreeAsync                                         │
│    0.13%16.78 ms │   57229.33 µs ± 15.69  (  7.6393.94)   │ cuMemcpyDtoDAsync                                      │
│    0.10%12.9 ms │   78416.46 µs ± 13.86  (  2.1576.77)   │ cudaMemsetAsync                                        │
│    0.01%1.49 ms │     8186.15 µs ± 132.94 ( 38.15478.51)  │ cudaMalloc                                             │
│    0.01%710.49 µs │    739.73 µs ± 1.78   (  1.9111.44)   │ cudaStreamSynchronize                                  │
│    0.00%535.01 µs │  1102485.49 ns ± 468.02 (   0.02384.19) │ cudaGetLastError                                       │
│    0.00%430.11 µs │  1144375.97 ns ± 314.69 (   0.01668.93) │ cuCtxPushCurrent                                       │
│    0.00%283.72 µs │  1144248.01 ns ± 178.15 (   0.0953.67)  │ cuCtxPopCurrent                                        │
│    0.00%243.9 µs │  1144213.2 ns ± 169.28 (   0.0715.26)  │ cuDeviceGet                                            │
│    0.00%240.09 µs │  1144209.87 ns ± 182.07 (   0.0953.67)  │ cuCtxGetDevice                                         │
│    0.00%84.4 µs │     1 │                                       │ cuMemGetInfo                                           │
│    0.00%53.41 µs │     317.8 µs ± 20.76  (  4.5341.72)   │ cuMemsetD32Async                                       │
│    0.00%12.87 µs │     62.15 µs ± 0.99   (  0.723.34)    │ cudaOccupancyMaxActiveBlocksPerMultiprocessorWithFlags │
│    0.00%2.15 µs │     21.07 µs ± 0.84   (  0.481.67)    │ cuMemPoolGetAttribute                                  │
│    0.00%1.91 µs │     3635.78 ns ± 688.26 (238.421430.51) │ cudaDeviceGetAttribute                                 │
│    0.00%1.67 µs │     1 │                                       │ cudaGetDevice                                          │
└──────────┴────────────┴───────┴───────────────────────────────────────┴────────────────────────────────────────────────────────┘

Device-side activity: GPU was busy for 10.13 s (79.13% of the trace)
┌──────────┬────────────┬───────┬────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────
│ Time (%) │ Total time │ Calls │ Time distribution                      │ Name                                                                              
├──────────┼────────────┼───────┼────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────
│   40.23%5.15 s │    6776.89 ms ± 0.2    ( 76.5377.38)    │ gpu__transfer_jtsj_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Cart 22.10%2.83 s │   11125.5 ms ± 25.79  (  0.0551.91)    │ gpu__transfer_to_csc_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Ca 2.63%336.15 ms │    675.02 ms ± 0.03   (  4.965.22)     │ void cudss::factorize_ker<long, double, int, double, 32, 1, 0, 0, 1, 0, 0, 0, 1>( 1.75%224.71 ms │     2112.35 ms ± 157.64 (  0.89223.82)   │ void cudss::radix_sort_ker<int, int, 1, 20, 4, 0>(int, int const*, int*, int*, in 1.35%173.45 ms │    672.59 ms ± 0.0    (  2.582.6)      │ void cudss::factorize_v3_ker<long, double, int, double, 256, 1, 0, 0, 1, 1, 0, 0, 1.14%145.91 ms │     1 │                                        │ void cudss::radix_sort_ker<long, int, 1, 20, 4, 1>(int, long const*, int*, int*,  1.05%134.73 ms │     1 │                                        │ void cudss::map_ker<long, int, int, 128, 1, 2>(int, int const*, int const*, int c 1.01%128.83 ms │   497259.22 µs ± 155.13 ( 20.27382.42)   │ void cusparse::csrmv_v3_transpose_kernel<int, int, double, double, double, double 0.96%123.07 ms │     1 │                                        │ void cudss::nnz_per_col_ker<int, int, 1, 0>(int, int const*, int const*, int cons 0.80%102.91 ms │     1 │                                        │ void cudss::trans_columns_ker<int, 2, 128>(int, int const*, int const*, int*, int 0.74%95.35 ms │   147648.65 µs ± 0.62   (647.31650.64)   │ void cudss::bwd_v2_ker<long, double, int, 32, 16, 1, 0, 0>(int const*, int const* 0.68%87.66 ms │   147596.31 µs ± 3.41   (589.85605.11)   │ void cudss::bwd_ker<long, double, int, 128, 128, 16, 8, 8, 1, 0, 1, 0>(int const* 0.57%72.64 ms │   147494.17 µs ± 1.89   (490.19499.25)   │ void cudss::fwd_v2_ker<long, double, int, 32, 1, 0, 0, 32, 1>(int const*, int con 0.44%56.56 ms │    66856.98 µs ± 1019.88 (  1.437880.45) │ [copy pageable to device memory]                                                  0.35%45.4 ms │     222.7 ms ± 32.05  (  0.0445.37)    │ gpu__set_coo_to_csc_map_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, 0.28%35.58 ms │     1 │                                        │ void cudss::trans_nnz_per_row_ker<int, 2, 128>(int, int const*, int const*, int*, 0.19%24.35 ms │    231.06 ms ± 0.15   (  0.671.25)     │ comparator_small_kernel(Tuple<CuDeviceArray<Tuple<Int64, Int64>, 1, 1>, CuDeviceA 0.18%22.6 ms │   105215.25 µs ± 46.07  ( 95.61312.09)   │ comparator_kernel(Tuple<CuDeviceArray<Tuple<Int64, Int64>, 1, 1>, CuDeviceArray<I 0.17%22.08 ms │     1 │                                        │ void cudss::adjncy_ker<int, int, 128, 2>(int, int const*, int const*, int*, int*, 0.13%16.86 ms │   147114.69 µs ± 2.06   (112.53121.36)   │ void cudss::fwd_v2_ker<long, double, int, 256, 1, 0, 0, 256, 1>(int const*, int c 0.12%15.2 ms │     1 │                                        │ gpu__build_condensed_aug_symbolic_hess_kernel_(CompilerMetadata<DynamicSize, Dyna 0.12%14.86 ms │     1 │                                        │ void cudss::map_offsets_ker<long, int, int, 128, 1>(int, int const*, int const*,  0.10%12.96 ms │   87614.79 µs ± 9.87   (   6.240.05)    │ [copy device to device memory]                                                    0.10%12.72 ms │  23075.51 µs ± 159.21 (  1.437647.28)  │ [copy device to pageable memory]                                                  0.09%11.9 ms │   110108.21 µs ± 1.25   (104.43110.86)   │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.09%10.97 ms │    42261.12 µs ± 35.6   (178.34303.03)   │ comparator_small_kernel(CuDeviceArray<Tuple<Tuple<Int32, Int32>, Int64>, 1, 1>, I 0.09%10.97 ms │    101.1 ms ± 3.17   (   0.010.08)    │ void cudss::dependency_map_ker<int, int, 32>(int, int const*, int const*, int con 0.08%9.92 ms │     1 │                                        │ void cudss::xadj_ker<int, int, 128, 2>(int, int const*, int const*, int*, int*, i 0.08%9.92 ms │   93810.57 µs ± 1.84   (   6.212.87)    │ void cusparse::csrmv_v3_partition_kernel<std::integral_constant<bool, false>, 256 0.07%8.64 ms │    63137.16 µs ± 17.18  ( 96.56161.41)   │ comparator_small_kernel(CuDeviceArray<Tuple<Int64, Int64>, 1, 1>, Int32, Int32, I 0.07%8.43 ms │   44119.11 µs ± 3.53   ( 13.8322.41)    │ void cusparse::csrmv_v3_kernel<std::integral_constant<bool, false>, int, int, dou 0.06%7.75 ms │     1 │                                        │ void cudss::fwd_bwd_order_ker<long, int, 256>(int, int, int*, int*, long const*,  0.06%7.74 ms │   46316.72 µs ± 3.96   (  6.6820.27)    │ partial_mapreduce_grid(norm, max, Float64, CartesianIndices<1, Tuple<OneTo<Int64> 0.06%7.45 ms │   55113.52 µs ± 10.79  (  5.7231.71)    │ void axpy_kernel_val<double, double>(cublasAxpyParamsVal<double, double, double>) 0.06%7.24 ms │   13254.86 µs ± 11.59  ( 25.7578.44)    │ comparator_kernel(CuDeviceArray<Tuple<Tuple<Int32, Int32>, Int64>, 1, 1>, Int32,  0.05%5.89 ms │   19829.75 µs ± 6.54   ( 14.0742.68)    │ comparator_kernel(CuDeviceArray<Tuple<Int64, Int64>, 1, 1>, Int32, Int32, Int32,  0.04%5.69 ms │    10568.7 µs ± 1743.12 (  1.915529.17) │ void cudss::csc_rows_ker<long, int, int, 256>(int, int, int const*, int const*, l 0.04%5.63 ms │     22.82 ms ± 0.01   (  2.812.82)     │ void offsets_par_ker<int, int, int, 128, 1>(int, int*, int*, int*, int*, int)     0.04%5.1 ms │   29417.33 µs ± 0.25   ( 16.6918.84)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.03%4.41 ms │    6765.78 µs ± 0.31   ( 65.0966.76)    │ void cudss::copy_matrix_ker<long, double, int, 128>(int, int const*, long const*, 0.03%4.27 ms │   40410.58 µs ± 1.68   (  8.5813.83)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.03%4.09 ms │   29413.9 µs ± 2.44   (  9.5417.64)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.03%3.52 ms │   6035.84 µs ± 2.56   (  1.4312.16)    │ gpu_fill_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndic 0.03%3.43 ms │   14723.31 µs ± 0.22   ( 22.8923.84)    │ void cudss::diag_ker<long, double, int, 256>(int, int, double*, long, double cons 0.02%3.12 ms │     1 │                                        │ void cudss::nnz_per_col_ker<int, int, 1, 1>(int, int const*, int const*, int cons 0.02%3.12 ms │     1 │                                        │ void offsets_par_ker<int, int, int, 128, 2>(int, int*, int*, int*, int*, int)     0.02%3.09 ms │     1 │                                        │ void offsets_par_ker<long, long, int, 128, 2>(long, long*, long*, int*, int*, int 0.02%3.07 ms │     1 │                                        │ void offsets_par_ker<long, long, long, 128, 2>(long, long*, long*, long*, int*, i 0.02%2.98 ms │   7873.79 µs ± 7.07   (  0.9597.99)    │ [set device memory]                                                               0.02%2.97 ms │   29410.11 µs ± 0.29   (   9.310.73)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.02%2.9 ms │   8103.58 µs ± 0.25   (  2.864.29)     │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<2, Tuple<OneTo<In 0.02%2.81 ms │     1 │                                        │ void offsets_par_ker<long, int, int, 128, 1>(long, long*, int*, int*, int*, int)  0.02%2.76 ms │   14718.76 µs ± 0.27   ( 18.1219.79)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.02%2.5 ms │    18138.65 µs ± 124.72 ( 16.21307.08)   │ partial_scan(add_sum, CuDeviceArray<Int64, 1, 1>, CuDeviceArray<Bool, 1, 1>, Cart 0.02%2.46 ms │   14716.76 µs ± 0.27   ( 16.2117.88)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.02%2.27 ms │     1 │                                        │ void cudss::modify_update_ker<long, int, 128>(int, int, long const*, int*, int co 0.02%2.08 ms │     1 │                                        │ gpu__build_condensed_aug_symbolic_jt_kernel_(CompilerMetadata<DynamicSize, Dynami 0.02%2.08 ms │   2269.19 µs ± 3.8    (   6.216.21)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.02%2.07 ms │   13415.47 µs ± 3.19   ( 11.6819.55)    │ gpu__transfer_hessian_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, C 0.02%2.05 ms │   3376.09 µs ± 2.49   (  5.2529.33)    │ partial_mapreduce_grid(identity, _, Bool, CartesianIndices<1, Tuple<OneTo<Int64>> 0.02%1.98 ms │   2248.85 µs ± 2.54   (  5.9611.92)    │ partial_mapreduce_grid(ComposedFunction<float, norm>, _, Float64, CartesianIndice 0.02%1.95 ms │   7912.47 µs ± 0.58   (  1.913.81)     │ void cusparse::vector_scalar_multiply_kernel<256, cusparse::AlignedVectorScalarMu 0.01%1.91 ms │   3365.7 µs ± 4.91   (  3.5855.55)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.79 ms │   14712.17 µs ± 0.8    ( 10.7313.59)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.69 ms │   14811.41 µs ± 0.31   ( 10.9714.31)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.63 ms │   14711.12 µs ± 0.19   ( 10.7311.68)    │ gpu__diag_operation_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.62 ms │   11014.72 µs ± 0.94   ( 13.3515.97)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.61 ms │   11014.63 µs ± 0.92   ( 13.3516.21)    │ partial_mapreduce_grid(identity, _, Float64, CartesianIndices<1, Tuple<OneTo<Int6 0.01%1.6 ms │   4993.21 µs ± 0.19   (  2.623.81)     │ partial_mapreduce_grid(identity, _, Float64, CartesianIndices<2, Tuple<OneTo<Int6 0.01%1.53 ms │    5527.8 µs ± 0.18   ( 27.4228.13)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.52 ms │    5527.71 µs ± 0.23   ( 27.1828.37)    │ partial_mapreduce_grid(identity, _, Float64, CartesianIndices<1, Tuple<OneTo<Int6 0.01%1.45 ms │    5625.94 µs ± 0.3    ( 25.5126.46)    │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<1, Tuple<OneTo<In 0.01%1.43 ms │   11812.09 µs ± 2.02   (  9.7815.02)    │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<1, Tuple<OneTo<In 0.01%1.4 ms │   11012.75 µs ± 1.2    ( 10.4914.54)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.3 ms │   1478.82 µs ± 0.19   (  8.349.3)      │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.29 ms │   11011.72 µs ± 0.45   ( 10.9712.64)    │ partial_mapreduce_grid(identity, _, Float64, CartesianIndices<1, Tuple<OneTo<Int6 0.01%1.23 ms │   11810.42 µs ± 1.46   (  8.5812.4)     │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<1, Tuple<OneTo<In 0.01%1.22 ms │   11011.1 µs ± 0.25   ( 10.4911.68)    │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.01%1.2 ms │   11010.88 µs ± 0.65   (  9.7812.16)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.01%1.16 ms │   3413.4 µs ± 0.56   (  2.866.68)     │ partial_mapreduce_grid(identity, _, Bool, CartesianIndices<2, Tuple<OneTo<Int64>, 0.01%1.08 ms │   1149.46 µs ± 0.27   (  8.8210.49)    │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.01%1.07 ms │   1676.41 µs ± 0.86   (  5.488.11)     │ partial_mapreduce_grid(_136<promote_<Float64>>, add_sum, Float64, CartesianIndice 0.01%1.04 ms │    5518.89 µs ± 0.4    ( 18.3620.03)    │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.01%1.03 ms │   1129.23 µs ± 1.01   (  7.8711.68)    │ gpu_linear_copy_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Cartesi 0.01%1.02 ms │     1 │                                        │ void cudss::radix_sort_ker<long, int, 1, 20, 4, 0>(int, long const*, int*, int*,  0.01%945.57 µs │   1476.43 µs ± 0.17   (  5.966.91)     │ void cudss::perm_ker<double, int, int, 128, 1>(int, double*, double*, int*)       0.01%838.99 µs │   1475.71 µs ± 0.16   (  5.485.96)     │ void cudss::perm_ker<double, int, int, 128, 0>(int, double*, double*, int*)       0.01%803.47 µs │     1 │                                        │ void cudss::compute_hybrid_minimum_chunk_size_ker<long, double, int, 128, 1>(int, 0.01%783.21 µs │    5514.24 µs ± 0.61   ( 12.8715.97)    │ partial_mapreduce_grid(identity, min, Float64, CartesianIndices<1, Tuple<OneTo<In 0.01%761.51 µs │   2203.46 µs ± 0.17   (  2.864.05)     │ partial_mapreduce_grid(identity, min, Float64, CartesianIndices<2, Tuple<OneTo<In 0.01%760.79 µs │    5713.35 µs ± 0.26   ( 12.8713.83)    │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.01%733.61 µs │    5513.34 µs ± 0.75   ( 11.6815.02)    │ partial_mapreduce_grid(identity, min, Float64, CartesianIndices<1, Tuple<OneTo<In 0.01%655.65 µs │   1115.91 µs ± 1.45   (  4.297.87)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%625.37 µs │    679.33 µs ± 1.61   (  5.7210.49)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%615.36 µs │    5511.19 µs ± 1.5    (  8.8215.02)    │ partial_mapreduce_grid(identity, min, Float64, CartesianIndices<1, Tuple<OneTo<In 0.00%606.54 µs │    5511.03 µs ± 0.26   ( 10.4911.68)    │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%598.91 µs │    5510.89 µs ± 1.11   (  9.7814.31)    │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<1, Tuple<OneTo<In 0.00%582.93 µs │    3118.8 µs ± 23.52  (  1.9165.09)    │ aggregate_partial_scan(add_sum, CuDeviceArray<Int64, 1, 1>, CuDeviceArray<Int64,  0.00%579.83 µs │   1115.22 µs ± 0.34   (  4.775.96)     │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%557.18 µs │    5510.13 µs ± 0.19   (  9.5410.49)    │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%556.71 µs │   1144.88 µs ± 0.22   (  4.536.2)      │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%544.07 µs │    559.89 µs ± 1.29   (  8.5813.11)    │ partial_mapreduce_grid(identity, min, Float64, CartesianIndices<1, Tuple<OneTo<In 0.00%538.11 µs │   1673.22 µs ± 0.15   (  2.863.58)     │ partial_mapreduce_grid(identity, add_sum, Float64, CartesianIndices<2, Tuple<OneT 0.00%518.32 µs │    559.42 µs ± 0.27   (  8.8210.01)    │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%505.45 µs │    578.87 µs ± 0.16   (  8.589.06)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%473.02 µs │    1531.53 µs ± 28.49  (  4.0578.2)     │ findall                                                                           0.00%411.51 µs │    805.14 µs ± 2.05   (  3.588.58)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%400.3 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%380.99 µs │    566.8 µs ± 0.21   (  6.447.87)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%372.65 µs │     1 │                                        │ void cudss::define_superpanel_ker<long, int, 256>(int, int, int, long const*, int 0.00%363.83 µs │    576.38 µs ± 0.42   (  5.727.63)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%337.12 µs │   1472.29 µs ± 0.16   (  1.912.62)     │ void cusparse::vector_scalar_multiply_kernel<256, cusparse::UnalignedVectorScalar 0.00%332.83 µs │     1 │                                        │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%288.72 µs │    644.51 µs ± 0.46   (  4.056.91)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%282.53 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%263.93 µs │    574.63 µs ± 0.16   (  4.295.01)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%262.26 µs │     1 │                                        │ void cudss::count_dep_fwd_bwd_ker<long, int, 256>(int, int, int*, int*, long cons 0.00%241.04 µs │   1172.06 µs ± 2.76   (  1.1926.7)     │ gpu_fill_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndic 0.00%232.22 µs │    574.07 µs ± 0.16   (  3.814.53)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%230.07 µs │    673.43 µs ± 0.12   (   3.13.58)     │ void cudss::independent_ker<long, double, int, double, 64, 1, 0, 0>(int, int, dou 0.00%215.77 µs │    573.79 µs ± 0.13   (  3.584.29)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%215.05 µs │    573.77 µs ± 0.14   (  3.584.05)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%214.34 µs │    573.76 µs ± 0.16   (  3.584.29)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%211.72 µs │    573.71 µs ± 0.14   (  3.584.05)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%206.71 µs │    573.63 µs ± 0.11   (  3.584.05)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%191.45 µs │    573.36 µs ± 0.1    (   3.13.58)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%190.02 µs │     1 │                                        │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%182.87 µs │     1 │                                        │ void cudss::updates_ker<long, int, 128>(int, int const*, int const*, long*, int c 0.00%167.85 µs │     1 │                                        │ void cudss::updates_offsets_ker<long, int, 128>(int, int const*, long const*, int 0.00%162.12 µs │    562.9 µs ± 0.14   (  2.623.1)      │ partial_mapreduce_grid(identity, add_sum, Float64, CartesianIndices<1, Tuple<OneT 0.00%160.22 µs │    1312.32 µs ± 8.06   (  6.4437.67)    │ partial_scan(add_sum, CuDeviceArray<Int64, 1, 1>, CuDeviceArray<Int64, 1, 1>, Car 0.00%148.53 µs │    572.61 µs ± 0.16   (  2.382.86)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%148.06 µs │    572.6 µs ± 0.15   (  2.382.86)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%146.63 µs │    572.57 µs ± 0.14   (  2.382.86)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%143.05 µs │    572.51 µs ± 0.14   (  2.152.62)     │ gpu_compress_to_dense(CompilerMetadata<DynamicSize, DynamicCheck, void, Cartesian 0.00%135.9 µs │    572.38 µs ± 0.19   (  1.912.62)     │ gpu_kerg(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%133.04 µs │    314.29 µs ± 1.69   (  1.917.15)     │ gpu_linear_copy_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Cartesi 0.00%124.22 µs │     1 │                                        │ void cudss::supernode_map_ker<int, 1>(int, int const*, int const*, int*, int, int 0.00%122.55 µs │    572.15 µs ± 0.18   (  1.912.38)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%115.63 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%111.1 µs │    561.98 µs ± 0.18   (  1.672.38)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%103.47 µs │    571.82 µs ± 0.16   (  1.432.15)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%103.47 µs │    571.82 µs ± 0.16   (  1.672.15)     │ gpu_kerf(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%102.04 µs │    571.79 µs ± 0.16   (  1.432.15)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%101.33 µs │    571.78 µs ± 0.18   (  1.432.15)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%101.09 µs │    195.32 µs ± 2.87   (  1.9111.44)    │ scan                                                                              0.00%100.61 µs │    571.77 µs ± 0.13   (  1.672.15)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%100.14 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%95.61 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%87.5 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%87.26 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%87.02 µs │    312.81 µs ± 0.84   (  1.194.29)     │ gpu_fill_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndic 0.00%82.73 µs │     420.68 µs ± 0.53   ( 20.0321.22)    │ gpu_linear_copy_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Cartesi 0.00%82.49 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%77.25 µs │     238.62 µs ± 2.7    ( 36.7240.53)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%77.25 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%76.77 µs │     238.39 µs ± 8.09   ( 32.6644.11)    │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%75.82 µs │     1 │                                        │ void cudss::supernode_map_offsets_ker<int, 1>(int, int const*, int const*, int*,  0.00%75.1 µs │    551.37 µs ± 0.16   (  1.191.67)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%73.19 µs │    551.33 µs ± 0.16   (  1.191.67)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%72.48 µs │    551.32 µs ± 0.15   (  1.191.67)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%72.24 µs │    551.31 µs ± 0.14   (  0.951.67)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%72.0 µs │    551.31 µs ± 0.15   (  1.191.67)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%70.81 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%66.52 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%63.42 µs │     231.71 µs ± 3.03   ( 29.5633.86)    │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%60.32 µs │    551.1 µs ± 0.17   (  0.951.43)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%60.08 µs │    551.09 µs ± 0.16   (  0.951.43)     │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%59.6 µs │    551.08 µs ± 0.16   (  0.951.43)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%59.6 µs │    551.08 µs ± 0.17   (  0.951.43)     │ gpu_kerh2(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, T 0.00%52.45 µs │     1 │                                        │ gpu__set_con_scale_sparse_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, voi 0.00%50.07 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%50.07 µs │     1 │                                        │ gpu__set_colptr_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, Cartesi 0.00%48.64 µs │     224.32 µs ± 0.67   ( 23.8424.8)     │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%48.4 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%47.92 µs │     223.96 µs ± 0.17   ( 23.8424.08)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%43.63 µs │     221.82 µs ± 7.92   ( 16.2127.42)    │ gpu__set_coo_to_colptr_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void,  0.00%40.53 µs │    123.38 µs ± 0.09   (  3.343.58)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%39.34 µs │     219.67 µs ± 0.17   ( 19.5519.79)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%38.86 µs │     1 │                                        │ void cudss::blocks_ker<long, int, 128>(int, int const*, long const*, int const*,  0.00%38.15 µs │     57.63 µs ± 2.68   (  4.7710.97)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%37.67 µs │     49.42 µs ± 2.64   (   6.212.64)    │ partial_mapreduce_grid(is_valid, _, Bool, CartesianIndices<1, Tuple<OneTo<Int64>> 0.00%35.05 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%33.86 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%31.95 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%29.33 µs │     214.66 µs ± 3.88   ( 11.9217.4)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%29.09 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%28.13 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%27.18 µs │     1 │                                        │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%26.94 µs │     38.98 µs ± 0.28   (  8.829.3)      │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%26.7 µs │     213.35 µs ± 0.0    ( 13.3513.35)    │ gpu_setindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%24.08 µs │     212.04 µs ± 0.84   ( 11.4412.64)    │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%23.84 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%21.7 µs │     45.42 µs ± 0.23   (  5.255.72)     │ partial_mapreduce_grid(identity, add_sum, Int64, CartesianIndices<1, Tuple<OneTo< 0.00%20.74 µs │     210.37 µs ± 0.17   ( 10.2510.49)    │ gpu_setindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%18.84 µs │     36.28 µs ± 0.14   (   6.26.44)     │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%18.12 µs │     1 │                                        │ void cudss::offsets_ker<int, 1>(int, int*)                                        0.00%17.88 µs │     28.94 µs ± 0.17   (  8.829.06)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%15.5 µs │     35.17 µs ± 0.96   (  4.296.2)      │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%15.02 µs │     27.51 µs ± 0.51   (  7.157.87)     │ gpu_fill_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndic 0.00%14.54 µs │     34.85 µs ± 0.77   (  4.295.72)     │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%14.31 µs │     27.15 µs ± 1.01   (  6.447.87)     │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%14.07 µs │     1 │                                        │ gpu__force_lower_triangular_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, v 0.00%12.87 µs │     26.44 µs ± 0.34   (   6.26.68)     │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%12.64 µs │     34.21 µs ± 0.28   (  4.054.53)     │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%12.4 µs │     1 │                                        │ partial_mapreduce_grid(identity, _, Int64, CartesianIndices<1, Tuple<OneTo<Int64> 0.00%12.16 µs │     43.04 µs ± 0.23   (  2.863.34)     │ partial_mapreduce_grid(identity, add_sum, Int64, CartesianIndices<2, Tuple<OneTo< 0.00%11.44 µs │     1 │                                        │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%10.97 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%10.73 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%10.25 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%10.25 µs │     1 │                                        │ void cudss::nnz_count_ker<long, int, 128>(int, int const*, int const*, long*, lon 0.00%8.34 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%7.87 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%6.91 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%6.44 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%6.2 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%6.2 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%6.2 µs │     1 │                                        │ partial_mapreduce_grid(identity, _, Int64, CartesianIndices<2, Tuple<OneTo<Int64> 0.00%6.2 µs │     1 │                                        │ gpu_getindex_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIn 0.00%5.48 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%5.48 µs │     1 │                                        │ gpu_map_kernel(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices 0.00%5.01 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%4.29 µs │     1 │                                        │ void cudss::supernode_dependant_ker<int, 128>(int, int*, int*, int*, int*)        0.00%4.29 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%4.05 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%3.58 µs │     1 │                                        │ void cudss::set_default_ker<int, 128>(int, int*)                                  0.00%3.58 µs │     1 │                                        │ gpu_broadcast_kernel_linear(CompilerMetadata<DynamicSize, DynamicCheck, void, Car 0.00%3.1 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.86 µs │     1 │                                        │ gpu_kerj(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.86 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.62 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.62 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.62 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.38 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.38 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.38 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%2.38 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 0.00%1.91 µs │     1 │                                        │ gpu_kerh(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1, Tu 
└──────────┴────────────┴───────┴────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────

@sshin23
Copy link
Member

sshin23 commented Jan 11, 2025

Now I think I see where the bottleneck is coming from. Variable tf appears in a large number of constrains. The kernels that are currently bottlenecked performs compression from coo to csc. For each csc entry we run serial for loop. So far we didn't have problem where a large number of uncompressed coo entries are mapped to a csc entry.

@jbcaillau
Copy link

@sshin23 good point. this is typical of problem with free final time (tf). with the effect that, contrary to what I answered to @amontoison, the column of derivatives wrt. to tf contains a long vector colinear to ones. a possibility is to recast the problem as one with fixed final time, up to the price of adding the trivial ODE $t_f' = 0$ and as many variables as tf[i], i = 1 to N + 1.

@amontoison
Copy link
Member Author

amontoison commented Jan 15, 2025

@jbcaillau @sshin23 @frapac
I tested the Goddard problem with our new solver MadNCL and I divided the elapsed time by two if we solve KKT systems with the formulation K2r (augmented system) instead of K1s (normal equation).

julia> CUDA.@profile MadNCL.solve!(solver)  # cuDSS + K2r
MadNCL algorithm

Total number of variables............................:      350008
Total number of constraints..........................:      450011

outer  inner     objective    inf_pr   inf_du    η        μ       ρ 
   0      0 -5.8505490e+01 1.02e-08 1.09e-09 1.00e-01 1.0e-01 1.00e+02
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 50 -5.8505490e+01 1.84e+03 1.00e+00  -1.0 5.00e-01    -  1.00e+00 1.00e+00h  1
 51 -5.5166787e+01 1.11e-01 1.09e-01  -1.0 1.84e+03    -  9.79e-01 1.00e+00h  1
   1     51 -5.9272031e+01 5.50e-02 1.09e-01 2.00e-03 2.0e-02 1.00e+02
 51 -4.6956298e+01 1.11e-01 5.50e+00  -1.7 1.84e+03    -  9.79e-01 1.00e+00h  1
 52 -4.9640344e+01 9.55e-02 2.55e+00  -1.7 3.04e+01    -  2.41e-01 1.00e+00h  1
 53 -5.1953591e+01 2.77e-02 2.43e-01  -1.7 3.81e+00    -  7.63e-01 1.00e+00h  1
   2     53 -6.7131864e+01 3.11e-02 2.43e-01 2.00e-03 2.0e-02 1.00e+03
 53  1.2008474e+01 2.77e-02 2.80e+01  -1.7 3.81e+00    -  7.63e-01 1.00e+00h  1
 54 -1.5580249e+00 2.10e-02 3.59e+00  -1.7 5.33e+00    -  8.58e-01 8.72e-01h  1
 55  8.6557668e+01 4.09e-03 6.72e-02  -1.7 3.59e+01    -  9.21e-01 1.00e+00h  1
   3     55 -9.8649629e+01 1.57e-02 6.72e-02 2.00e-03 2.0e-02 1.00e+04
 55  1.6508346e+03 4.09e-03 1.41e+02  -1.7 3.59e+01    -  9.21e-01 1.00e+00h  1
 56  2.4071415e+02 3.74e-02 4.74e-02  -1.7 5.39e+01    -  1.00e+00 1.00e+00h  1
   4     56 -4.4719603e+01 3.84e-03 4.74e-02 2.00e-03 2.0e-02 1.00e+05
 56  2.7638501e+03 3.74e-02 3.45e+02  -1.7 5.39e+01    -  1.00e+00 1.00e+00h  1
 57  1.7232742e+02 3.58e-02 1.71e-01  -1.7 3.28e+01    -  1.00e+00 1.00e+00h  1
   5     57 -1.1885306e+01 1.15e-03 1.71e-01 4.00e-04 4.0e-03 1.00e+05
 57  5.3821207e+02 3.58e-02 1.15e+02  -2.4 3.28e+01    -  1.00e+00 1.00e+00h  1
 58  1.1329393e+02 3.42e-02 5.30e-02  -2.4 7.88e+00    -  9.94e-01 1.00e+00h  1
   6     58 -4.0055188e+00 3.22e-04 5.30e-02 8.00e-05 8.0e-04 1.00e+05
 58  1.4238671e+02 3.42e-02 3.22e+01  -3.1 7.88e+00    -  9.94e-01 1.00e+00h  1
 59  3.3451678e+01 3.76e-02 5.50e-02  -3.1 2.23e+00    -  8.96e-01 1.00e+00h  1
   7     59 -1.7762561e+00 1.06e-04 5.50e-02 8.00e-05 8.0e-04 1.00e+06
 59  4.3728795e+01 3.76e-02 9.52e+01  -3.1 2.23e+00    -  8.96e-01 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 60  3.1460631e+01 1.66e-03 7.04e-01  -3.1 5.90e-01    -  1.00e+00 1.00e+00h  1
 61  3.3545820e+01 9.10e-05 1.95e-04  -3.1 2.39e-01    -  1.00e+00 1.00e+00h  1
   8     61 -1.6436231e+00 6.74e-05 1.95e-04 1.60e-05 1.6e-04 1.00e+06
 61  4.7776421e+01 9.10e-05 6.74e+01  -3.8 2.39e-01    -  1.00e+00 1.00e+00h  1
 62  6.4907327e+00 3.69e-02 6.74e-01  -3.8 7.72e-01    -  9.80e-01 1.00e+00h  1
 63  7.4583765e+00 2.79e-04 7.20e-02  -3.8 1.41e+00    -  1.00e+00 1.00e+00h  1
 64  7.3868438e+00 4.18e-06 9.48e-04  -3.8 2.60e-01    -  1.00e+00 1.00e+00h  1
   9     64 -1.1206517e+00 1.16e-05 9.48e-04 3.20e-06 3.2e-05 1.00e+06
 64  8.2356167e+00 4.18e-06 1.16e+01  -4.5 2.60e-01    -  1.00e+00 1.00e+00h  1
 65  7.6833037e-01 3.68e-03 5.86e-01  -4.5 8.87e-01    -  1.00e+00 1.00e+00h  1
 66  5.1726664e-01 4.57e-04 8.08e-03  -4.5 5.67e-02  -3.4 1.00e+00 1.00e+00h  1
 67  4.9360534e-01 8.48e-06 1.70e-03  -4.5 1.30e-01  -3.9 1.00e+00 1.00e+00h  1
  10     67 -1.0245727e+00 5.49e-06 1.70e-03 3.20e-06 3.2e-05 1.00e+07
 67  1.0188374e+00 8.48e-06 4.95e+01  -4.5 1.30e-01  -3.9 1.00e+00 1.00e+00h  1
 68 -5.9019994e-02 4.95e-03 7.09e+00  -4.5 2.49e+00    -  4.80e-01 1.00e+00H  1
 69 -1.6284289e-02 6.94e-04 1.66e-02  -4.5 1.12e+00    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 70 -1.7971694e-02 1.09e-04 8.74e-04  -4.5 7.59e-01    -  1.00e+00 1.00e+00h  1
  11     70 -1.0248683e+00 7.54e-06 8.74e-04 3.20e-06 3.2e-05 1.00e+08
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 70  1.3064956e+00 1.09e-04 6.79e+02  -4.5 7.59e-01    -  1.00e+00 1.00e+00h  1
 71 -2.2420547e-01 5.05e-03 2.93e+01  -4.5 4.97e-01    -  4.20e-01 1.00e+00h  1
 72 -6.2036534e-02 5.85e-04 1.15e-03  -4.5 1.05e-01    -  1.00e+00 1.00e+00h  1
  12     72 -1.0196324e+00 1.27e-06 1.15e-03 6.40e-07 6.4e-06 1.00e+08
 72  3.8344221e-01 5.85e-04 1.27e+02  -5.2 1.05e-01    -  1.00e+00 1.00e+00h  1
 73 -1.0994926e+00 7.86e-02 1.36e+00  -5.2 1.18e+00    -  7.82e-01 1.00e+00h  1
 74 -1.0290048e+00 7.50e-04 7.83e-02  -5.2 8.21e-01    -  1.00e+00 1.00e+00h  1
 75 -1.0506458e+00 3.24e-04 1.06e-02  -5.2 3.54e-01    -  1.00e+00 1.00e+00h  1
 76 -1.0508501e+00 1.89e-06 1.40e-05  -5.2 2.62e-02    -  1.00e+00 1.00e+00h  1
  13     76 -1.0063088e+00 3.52e-07 1.40e-05 1.16e-07 1.2e-06 1.00e+08
 76 -1.0142486e+00 1.89e-06 3.52e+01  -5.9 2.62e-02    -  1.00e+00 1.00e+00h  1
 77 -1.2114770e+00 2.09e-02 8.82e-02  -5.9 5.31e-01    -  8.86e-01 1.00e+00h  1
 78 -1.2541092e+00 6.25e-03 3.20e-02  -5.9 4.56e-01    -  1.00e+00 7.58e-01h  1
 79 -1.2627063e+00 9.16e-04 1.19e-02  -5.9 2.89e-01    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
 80 -1.2656895e+00 1.31e-04 8.35e-04  -5.9 1.52e-01    -  1.00e+00 1.00e+00h  1
 81 -1.2666296e+00 1.34e-05 9.43e-05  -5.9 4.21e-02    -  1.00e+00 1.00e+00h  1
 82 -1.2668871e+00 9.50e-07 7.85e-06  -5.9 1.86e-02    -  1.00e+00 1.00e+00h  1
  14     82 -1.0018805e+00 2.03e-07 7.85e-06 1.65e-08 1.6e-07 1.00e+08
 82 -1.2196642e+00 9.50e-07 2.03e+01  -6.8 1.86e-02    -  1.00e+00 1.00e+00h  1
 83 -1.2374161e+00 6.10e-04 1.31e+01  -6.8 5.37e-01    -  9.26e-01 3.55e-01h  1
 84 -1.2779401e+00 6.36e-03 3.47e-02  -6.8 9.97e-01    -  1.00e+00 1.00e+00h  1
 85 -1.2759068e+00 4.48e-04 5.78e-05  -6.8 3.97e-01    -  1.00e+00 1.00e+00h  1
 86 -1.2758056e+00 8.54e-06 4.20e-06  -6.8 7.20e-02    -  1.00e+00 1.00e+00h  1
 87 -1.2758043e+00 1.55e-09 1.08e-09  -6.8 1.58e-03    -  1.00e+00 1.00e+00h  1
  15     87 -1.0004278e+00 2.17e-07 1.08e-09 1.77e-09 1.8e-08 1.00e+08
Profiler ran for 4.12 s, capturing 867992 events.

Host-side activity: calling CUDA APIs took 396.24 ms (9.63% of the trace)
┌──────────┬────────────┬───────┬─────────────────────────────────────────┬─────────────────────────────┐
│ Time (%) │ Total time │ Calls │ Time distribution                       │ Name                        │
├──────────┼────────────┼───────┼─────────────────────────────────────────┼─────────────────────────────┤
│   27.88%1.15 s │  6350180.68 µs ± 2271.95 (  0.4831003.48) │ cuStreamSynchronize         │
│    1.24%50.96 ms │ 102964.95 µs ± 0.98   (  3.5831.71)     │ cuLaunchKernel              │
│    0.65%26.62 ms │  198713.4 µs ± 1.27   ( 11.4424.08)     │ cuMemcpyDtoHAsync           │
│    0.38%15.76 ms │  33564.69 µs ± 0.62   (  3.8111.44)     │ cudaLaunchKernel            │
│    0.36%14.91 ms │  42863.48 µs ± 1.33   (  1.4319.31)     │ cuMemAllocFromPoolAsync     │
│    0.32%13.32 ms │    55242.25 µs ± 42.7   (222.68383.38)    │ cuMemcpyHtoDAsync           │
│    0.16%6.53 ms │   65210.02 µs ± 1.79   (  7.6328.85)     │ cuMemcpyDtoDAsync           │
│    0.10%4.16 ms │   33112.58 µs ± 2.96   (  8.5823.6)      │ cudaMemcpyAsync             │
│    0.06%2.54 ms │   5045.04 µs ± 2.05   (  2.3831.23)     │ cudaMemsetAsync             │
│    0.02%1.02 ms │   4202.44 µs ± 0.59   (  1.435.48)      │ cuMemFreeAsync              │
│    0.01%413.18 µs │  1276323.81 ns ± 183.02 (   0.02384.19)   │ cudaStreamGetCaptureInfo_v2 │
│    0.01%373.36 µs │   1083.46 µs ± 0.76   (  2.387.15)      │ cudaFuncGetAttributes       │
│    0.01%360.73 µs │   1472.45 µs ± 0.29   (  1.913.34)      │ cudaStreamSynchronize       │
│    0.01%280.14 µs │   292959.39 ns ± 556.05 (238.423814.7)    │ cudaEventRecord             │
│    0.00%205.76 µs │  1380149.1 ns ± 172.67 (   0.01430.51)   │ cudaGetLastError            │
│    0.00%158.07 µs │  1304121.22 ns ± 133.07 (   0.0476.84)    │ cuCtxPushCurrent            │
│    0.00%144.48 µs │  1304110.8 ns ± 132.49 (   0.0476.84)    │ cuCtxPopCurrent             │
│    0.00%115.16 µs │  130488.31 ns ± 129.11 (   0.0476.84)    │ cuCtxGetDevice              │
│    0.00%104.43 µs │  130480.08 ns ± 123.01 (   0.0476.84)    │ cuDeviceGet                 │
│    0.00%70.57 µs │    80882.15 ns ± 664.03 (238.423337.86)   │ cudaFuncSetAttribute        │
│    0.00%37.43 µs │    92406.87 ns ± 167.8  (238.42953.67)    │ cudaMalloc                  │
└──────────┴────────────┴───────┴─────────────────────────────────────────┴─────────────────────────────┘

Device-side activity: GPU was busy for 2.62 s (63.56% of the trace)
┌──────────┬────────────┬───────┬──────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ Time (%) │ Total time │ Calls │ Time distribution                    │ Name                                                                                                                              
├──────────┼────────────┼───────┼──────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│   21.10%868.11 ms │    4021.7 ms ± 0.35   ( 21.1322.93)  │ void cudss::update_ker<long, double, int, double, 256, 1, 0, 0>(int, int, double*, double*, int const*, int const*, int*, int con 9.43%387.97 ms │    409.7 ms ± 0.02   (  9.679.78)   │ void cudss::factorize_ker<long, double, int, double, 32, 1, 0, 0, 1, 0, 0, 0, 1>(int, int, int, double*, double*, long const*, in 5.83%239.9 ms │    406.0 ms ± 0.05   (  5.856.07)   │ void cudss::factorize_v3_ker<long, double, int, double, 256, 1, 0, 0, 1, 1, 0, 0, 4>(int, int, int, int, double*, double*, long c 5.60%230.33 ms │    922.5 ms ± 0.0    (   2.52.51)   │ void cudss::bwd_v2_ker<long, double, int, 32, 16, 1, 0, 0>(int const*, int const*, int, int, double*, double*, int const*, long c 5.39%221.61 ms │    405.54 ms ± 0.0    (  5.535.55)   │ void cudss::kernel<cudss::getrf_params_<double, 2, 256, 1, 64, 64, 68, 16, 1, 1>>(int, int, void*, int, void*, int, int, int, int 4.37%179.82 ms │    921.95 ms ± 0.01   (  1.941.97)   │ void cudss::fwd_v2_ker<long, double, int, 256, 1, 0, 0, 256, 1>(int const*, int const*, int, int, double*, int const*, long const 3.67%150.89 ms │    921.64 ms ± 0.0    (  1.631.65)   │ void cudss::fwd_v2_ker<long, double, int, 32, 1, 0, 0, 32, 1>(int const*, int const*, int, int, double*, int const*, long const*, 3.27%134.45 ms │    921.46 ms ± 0.03   (  1.411.53)   │ void cudss::bwd_ker<long, double, int, 128, 128, 16, 8, 8, 1, 0, 1, 0>(int const*, int const*, int, int, double*, double*, int co 0.76%31.46 ms │   131240.18 µs ± 178.03 ( 27.66430.35) │ gpu__transfer_to_map_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, Dy 0.64%26.3 ms │    92285.92 µs ± 0.96   (283.72288.25) │ void trsv_lt_exec<double, 32u, 32u, 4u, true, false>(int, double const*, long, double*, long, int*)                               0.47%19.32 ms │    92210.03 µs ± 0.83   (208.14212.67) │ void trsv_ln_exec<double, 32u, 32u, 4u, true>(int, double const*, long, double*, long, int*)                                      0.29%12.04 ms │    55218.89 µs ± 27.14  (206.71309.71) │ [copy pageable to device memory]                                                                                                  0.20%8.31 ms │   8369.93 µs ± 4.32   (  5.4820.27)  │ [copy device to device memory]                                                                                                    0.12%4.82 ms │   23620.41 µs ± 6.66   (  12.428.61)  │ void cusparse::csrmv_v3_kernel<std::integral_constant<bool, false>, int, int, double, double, double, double, void>(cusparse::Ker 0.11%4.57 ms │   34413.28 µs ± 2.83   (  7.1518.36)  │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64> 0.11%4.55 ms │   18424.74 µs ± 9.56   ( 14.5436.24)  │ void cusparse::csrmv_v3_transpose_kernel<int, int, double, double, double, double, void>(cusparse::KernelCoeffs<double>, int cons 0.11%4.34 ms │   9224.7 µs ± 1.85   (  2.6210.73)  │ _34(CuKernelContext, CuDeviceArray<Float64, 1l, 1l>, Broadcasted<CuArrayStyle<1l, DeviceMemory>, Tuple<OneTo<Int64>>, identity, D 0.10%4.24 ms │   42010.1 µs ± 2.05   (   6.212.16)  │ void cusparse::csrmv_v3_partition_kernel<std::integral_constant<bool, false>, 256, int, int, double, double, double>(int const*,  0.10%4.02 ms │    40100.39 µs ± 0.79   ( 98.94102.52) │ void cudss::finalize_permute_ker<int, double, 256>(long, double*, long, int*, int*, int*, int*, int, int, int)                    
julia> CUDA.@profile MadNCL.solve!(solver2)  # cuDSS + K1s
MadNCL algorithm

Total number of variables............................:      350008
Total number of constraints..........................:      450011

outer  inner     objective    inf_pr   inf_du    η        μ       ρ 
   0      0 -5.8505490e+01 1.55e-09 1.08e-09 1.00e-01 1.0e-01 1.00e+02
178 -5.8505490e+01 1.84e+03 1.00e+00  -1.0 5.00e-01    -  1.00e+00 1.00e+00h  1
179 -5.5166787e+01 1.11e-01 1.09e-01  -1.0 1.84e+03    -  9.79e-01 1.00e+00h  1
   1    179 -5.9272031e+01 5.50e-02 1.09e-01 2.00e-03 2.0e-02 1.00e+02
179 -4.6956298e+01 1.11e-01 5.50e+00  -1.7 1.84e+03    -  9.79e-01 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
180 -4.9640344e+01 9.55e-02 2.55e+00  -1.7 3.04e+01    -  2.41e-01 1.00e+00h  1
181 -5.1953591e+01 2.77e-02 2.43e-01  -1.7 3.81e+00    -  7.63e-01 1.00e+00h  1
   2    181 -6.7131864e+01 3.11e-02 2.43e-01 2.00e-03 2.0e-02 1.00e+03
181  1.2008474e+01 2.77e-02 2.80e+01  -1.7 3.81e+00    -  7.63e-01 1.00e+00h  1
182 -1.5580249e+00 2.10e-02 3.59e+00  -1.7 5.33e+00    -  8.58e-01 8.72e-01h  1
183  8.6557668e+01 4.09e-03 6.72e-02  -1.7 3.59e+01    -  9.21e-01 1.00e+00h  1
   3    183 -9.8649629e+01 1.57e-02 6.72e-02 2.00e-03 2.0e-02 1.00e+04
183  1.6508346e+03 4.09e-03 1.41e+02  -1.7 3.59e+01    -  9.21e-01 1.00e+00h  1
184  2.4071412e+02 3.74e-02 4.74e-02  -1.7 5.39e+01    -  1.00e+00 1.00e+00h  1
   4    184 -4.4719599e+01 3.84e-03 4.74e-02 2.00e-03 2.0e-02 1.00e+05
184  2.7638497e+03 3.74e-02 3.45e+02  -1.7 5.39e+01    -  1.00e+00 1.00e+00h  1
185  1.7232743e+02 3.58e-02 1.71e-01  -1.7 3.28e+01    -  1.00e+00 1.00e+00h  1
   5    185 -1.1885306e+01 1.15e-03 1.71e-01 4.00e-04 4.0e-03 1.00e+05
185  5.3821209e+02 3.58e-02 1.15e+02  -2.4 3.28e+01    -  1.00e+00 1.00e+00h  1
186  1.1329393e+02 3.42e-02 5.30e-02  -2.4 7.88e+00    -  9.94e-01 1.00e+00h  1
   6    186 -4.0055187e+00 3.22e-04 5.30e-02 8.00e-05 8.0e-04 1.00e+05
186  1.4238670e+02 3.42e-02 3.22e+01  -3.1 7.88e+00    -  9.94e-01 1.00e+00h  1
187  3.3451678e+01 3.76e-02 5.50e-02  -3.1 2.23e+00    -  8.96e-01 1.00e+00h  1
   7    187 -1.7762561e+00 1.06e-04 5.50e-02 8.00e-05 8.0e-04 1.00e+06
187  4.3728795e+01 3.76e-02 9.52e+01  -3.1 2.23e+00    -  8.96e-01 1.00e+00h  1
188  3.1460631e+01 1.66e-03 7.04e-01  -3.1 5.90e-01    -  1.00e+00 1.00e+00h  1
189  3.3545820e+01 9.10e-05 1.95e-04  -3.1 2.39e-01    -  1.00e+00 1.00e+00h  1
   8    189 -1.6436231e+00 6.74e-05 1.95e-04 1.60e-05 1.6e-04 1.00e+06
189  4.7776421e+01 9.10e-05 6.74e+01  -3.8 2.39e-01    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
190  6.4907326e+00 3.69e-02 6.74e-01  -3.8 7.72e-01    -  9.80e-01 1.00e+00h  1
191  7.4583766e+00 2.79e-04 7.20e-02  -3.8 1.41e+00    -  1.00e+00 1.00e+00h  1
192  7.3868438e+00 4.18e-06 9.48e-04  -3.8 2.60e-01    -  1.00e+00 1.00e+00h  1
   9    192 -1.1206517e+00 1.16e-05 9.48e-04 3.20e-06 3.2e-05 1.00e+06
192  8.2356167e+00 4.18e-06 1.16e+01  -4.5 2.60e-01    -  1.00e+00 1.00e+00h  1
193  7.6833040e-01 3.68e-03 5.86e-01  -4.5 8.87e-01    -  1.00e+00 1.00e+00h  1
194  1.5744121e-01 2.44e-03 3.38e-01  -4.5 8.78e-01  -5.0 1.00e+00 1.00e+00h  1
195 -3.1471483e-01 1.39e-03 1.57e-01  -4.5 4.42e-01  -4.6 1.00e+00 1.00e+00h  1
196 -6.3479489e-01 4.24e-04 2.88e-02  -4.5 1.99e-01  -4.2 1.00e+00 1.00e+00h  1
197 -1.2323752e+00 3.12e-03 2.00e+00  -4.5 1.15e+00  -4.7 1.00e+00 5.00e-01h  2
198 -2.0016308e+00 3.30e-03 5.70e-02  -4.5 4.60e-01  -4.2 1.00e+00 1.00e+00h  1
199 -2.3625247e+00 4.59e-03 8.95e-01  -4.5 1.56e+02    -  1.13e-02 2.06e-02h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
200 -2.6550833e+00 4.33e-03 2.03e-01  -4.5 4.77e+00    -  4.13e-01 2.83e-01h  1
201 -2.8621516e+00 1.51e-03 1.06e-02  -4.5 6.39e-01    -  1.00e+00 1.00e+00h  1
202 -2.8558890e+00 6.83e-05 3.90e-04  -4.5 2.34e-01    -  1.00e+00 1.00e+00h  1
  10    202 -1.0279300e+00 3.80e-05 3.90e-04 3.20e-06 3.2e-05 1.00e+07
202  2.1027269e+01 6.83e-05 3.42e+02  -4.5 2.34e-01    -  1.00e+00 1.00e+00h  1
203  3.1390477e-01 2.86e-02 1.20e+00  -4.5 2.36e+00    -  8.01e-01 1.00e+00h  1
204  2.4291486e-01 2.40e-02 1.98e+00  -4.5 4.32e+01    -  6.58e-01 1.58e-01h  1
205 -2.4868202e-02 7.69e-03 1.51e+00  -4.5 2.24e+00    -  4.01e-01 1.00e+00h  1
206 -1.7954904e-02 2.28e-05 5.91e-03  -4.5 5.43e+00    -  1.00e+00 1.00e+00h  1
207 -1.7298746e-02 8.88e-07 1.89e-04  -4.5 9.90e-01    -  1.00e+00 1.00e+00h  1
  11    207 -1.0248676e+00 7.52e-06 1.89e-04 3.20e-06 3.2e-05 1.00e+08
207  1.3043705e+00 8.88e-07 6.77e+02  -4.5 9.90e-01    -  1.00e+00 1.00e+00h  1
208 -2.2420396e-01 5.05e-03 2.91e+01  -4.5 4.94e-01    -  4.22e-01 1.00e+00h  1
209 -6.2104087e-02 5.83e-04 1.13e-03  -4.5 1.01e-01    -  1.00e+00 1.00e+00h  1
  12    209 -1.0196317e+00 1.27e-06 1.13e-03 6.40e-07 6.4e-06 1.00e+08
209  3.8332369e-01 5.83e-04 1.27e+02  -5.2 1.01e-01    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
210 -1.0994861e+00 7.86e-02 1.36e+00  -5.2 1.18e+00    -  7.82e-01 1.00e+00h  1
211 -1.0290005e+00 7.50e-04 7.83e-02  -5.2 8.21e-01    -  1.00e+00 1.00e+00h  1
212 -1.0506425e+00 3.24e-04 1.06e-02  -5.2 3.54e-01    -  1.00e+00 1.00e+00h  1
213 -1.0508466e+00 1.90e-06 1.40e-05  -5.2 2.62e-02    -  1.00e+00 1.00e+00h  1
  13    213 -1.0063088e+00 3.52e-07 1.40e-05 1.16e-07 1.2e-06 1.00e+08
213 -1.0142439e+00 1.90e-06 3.52e+01  -5.9 2.62e-02    -  1.00e+00 1.00e+00h  1
214 -1.2114719e+00 2.09e-02 8.82e-02  -5.9 5.31e-01    -  8.86e-01 1.00e+00h  1
215 -1.2541043e+00 6.25e-03 3.20e-02  -5.9 4.56e-01    -  1.00e+00 7.58e-01h  1
216 -1.2627006e+00 9.16e-04 1.19e-02  -5.9 2.89e-01    -  1.00e+00 1.00e+00h  1
217 -1.2656838e+00 1.31e-04 8.35e-04  -5.9 1.52e-01    -  1.00e+00 1.00e+00h  1
218 -1.2666239e+00 1.34e-05 9.43e-05  -5.9 4.21e-02    -  1.00e+00 1.00e+00h  1
219 -1.2668814e+00 9.50e-07 7.85e-06  -5.9 1.86e-02    -  1.00e+00 1.00e+00h  1
  14    219 -1.0018806e+00 2.03e-07 7.85e-06 1.65e-08 1.6e-07 1.00e+08
219 -1.2196587e+00 9.50e-07 2.03e+01  -6.8 1.86e-02    -  1.00e+00 1.00e+00h  1
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
220 -1.2374110e+00 6.10e-04 1.31e+01  -6.8 5.37e-01    -  9.26e-01 3.55e-01h  1
221 -1.2779345e+00 6.36e-03 3.47e-02  -6.8 9.97e-01    -  1.00e+00 1.00e+00h  1
222 -1.2759012e+00 4.48e-04 5.78e-05  -6.8 4.44e-01    -  1.00e+00 1.00e+00h  1
223 -1.2757999e+00 1.02e-05 4.20e-06  -6.8 8.63e-02    -  1.00e+00 1.00e+00h  1
224 -1.2757987e+00 1.55e-09 1.08e-09  -6.8 1.58e-03    -  1.00e+00 1.00e+00h  1
  15    224 -1.0004278e+00 2.17e-07 1.08e-09 1.77e-09 1.8e-08 1.00e+08
Profiler ran for 8.07 s, capturing 1422567 events.

Host-side activity: calling CUDA APIs took 1.11 s (13.71% of the trace)
┌──────────┬────────────┬───────┬─────────────────────────────────────────┬─────────────────────────────┐
│ Time (%) │ Total time │ Calls │ Time distribution                       │ Name                        │
├──────────┼────────────┼───────┼─────────────────────────────────────────┼─────────────────────────────┤
│   41.85%3.38 s │ 10075335.06 µs ± 4523.92 (  0.4863260.79) │ cuStreamSynchronize         │
│    1.01%81.73 ms │ 165794.93 µs ± 0.97   (  3.5833.62)     │ cuLaunchKernel              │
│    0.60%48.36 ms │  358713.48 µs ± 2.32   ( 11.44123.98)    │ cuMemcpyDtoHAsync           │
│    0.37%29.65 ms │  98043.02 µs ± 1.43   (  1.1978.68)     │ cuMemAllocFromPoolAsync     │
│    0.20%16.13 ms │    65248.09 µs ± 47.4   (221.97399.35)    │ cuMemcpyHtoDAsync           │
│    0.20%15.78 ms │  32664.83 µs ± 0.83   (  3.8120.27)     │ cudaLaunchKernel            │
│    0.19%15.26 ms │  82781.84 µs ± 1.0    (  0.9562.47)     │ cuMemFreeAsync              │
│    0.06%4.6 ms │   35113.12 µs ± 3.5    (  8.3431.95)     │ cudaMemcpyAsync             │
│    0.06%4.56 ms │   40611.24 µs ± 1.42   (  8.1118.12)     │ cuMemcpyDtoDAsync           │
│    0.04%2.99 ms │   5535.41 µs ± 3.0    (  2.3838.86)     │ cudaMemsetAsync             │
│    0.01%448.7 µs │   1293.48 µs ± 0.83   (  2.627.15)      │ cudaFuncGetAttributes       │
│    0.01%437.74 µs │   1832.39 µs ± 0.29   (  1.674.05)      │ cudaStreamSynchronize       │
│    0.00%208.62 µs │   645323.44 ns ± 189.77 (   0.01430.51)   │ cudaStreamGetCaptureInfo_v2 │
│    0.00%167.13 µs │   1291.3 µs ± 0.93   (  0.483.58)      │ cudaEventRecord             │
│    0.00%165.46 µs │   894185.08 ns ± 303.1  (   0.06675.72)   │ cudaGetLastError            │
│    0.00%129.22 µs │   812159.14 ns ± 139.64 (   0.0715.26)    │ cuCtxPushCurrent            │
│    0.00%111.58 µs │   812137.41 ns ± 135.58 (   0.0476.84)    │ cuCtxPopCurrent             │
│    0.00%79.15 µs │   81297.48 ns ± 127.59 (   0.0476.84)    │ cuCtxGetDevice              │
│    0.00%62.47 µs │   82076.18 ns ± 122.52 (   0.0476.84)    │ cuDeviceGet                 │
│    0.00%238.42 ns │     926.49 ns ± 79.47  (   0.0238.42)    │ cuDeviceGetCount            │
└──────────┴────────────┴───────┴─────────────────────────────────────────┴─────────────────────────────┘

Device-side activity: GPU was busy for 5.0 s (62.03% of the trace)
┌──────────┬────────────┬───────┬──────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│ Time (%) │ Total time │ Calls │ Time distribution                    │ Name                                                                                                                              
├──────────┼────────────┼───────┼──────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
│   51.61%4.16 s │    5575.69 ms ± 0.13   ( 75.4275.97)  │ gpu__transfer_jtsj_kernel_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1 3.41%275.07 ms │    555.0 ms ± 0.04   (  4.965.18)   │ void cudss::factorize_ker<long, double, int, double, 32, 1, 0, 0, 1, 0, 0, 0, 1>(int, int, int, double*, double*, long const*, in 1.76%141.62 ms │    552.57 ms ± 0.0    (  2.562.59)   │ void cudss::factorize_v3_ker<long, double, int, double, 256, 1, 0, 0, 1, 1, 0, 0, 4>(int, int, int, int, double*, double*, long c 1.36%109.76 ms │   397276.49 µs ± 134.17 (  17.4351.91) │ void cusparse::csrmv_v3_transpose_kernel<int, int, double, double, double, double, void>(cusparse::KernelCoeffs<double>, int cons 0.67%54.43 ms │    84647.98 µs ± 0.57   (646.83650.41) │ void cudss::bwd_v2_ker<long, double, int, 32, 16, 1, 0, 0>(int const*, int const*, int, int, double*, double*, int const*, long c 0.61%49.03 ms │    84583.74 µs ± 2.94   (578.17592.71) │ void cudss::bwd_ker<long, double, int, 128, 128, 16, 8, 8, 1, 0, 1, 0>(int const*, int const*, int, int, double*, double*, int co 0.53%42.56 ms │    84506.61 µs ± 1.97   (503.06512.12) │ void cudss::fwd_v2_ker<long, double, int, 32, 1, 0, 0, 32, 1>(int const*, int const*, int, int, double*, int const*, long const*, 0.21%17.3 ms │   109158.68 µs ± 161.73 ( 17.88344.28) │ gpu__transfer_to_map_(CompilerMetadata<DynamicSize, DynamicCheck, void, CartesianIndices<1l, Tuple<OneTo<Int64>>>, NDRange<1l, Dy 0.18%14.43 ms │    65221.97 µs ± 29.14  (207.19308.75) │ [copy pageable to device memory]                                                                                                  0.12%9.6 ms │    84114.26 µs ± 2.47   ( 111.1122.79) │ void cudss::fwd_v2_ker<long, double, int, 256, 1, 0, 0, 256, 1>(int const*, int const*, int, int, double*, int const*, long const 0.10%7.91 ms │  15115.23 µs ± 0.21   (  4.776.2)    │ partial_mapreduce_grid(identity, _, Bool, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64>>>, V 0.09%6.86 ms │   64910.57 µs ± 1.69   (   6.212.16)  │ void cusparse::csrmv_v3_partition_kernel<std::integral_constant<bool, false>, 256, int, int, double, double, double>(int const*,  0.08%6.69 ms │  37701.77 µs ± 0.17   (  1.432.38)   │ [copy device to pageable memory]                                                                                                  0.07%5.82 ms │   57410.14 µs ± 4.84   (  5.7220.27)  │ [copy device to device memory]                                                                                                    0.06%5.24 ms │   7197.28 µs ± 3.73   (  3.5817.17)  │ _Z3_3415CuKernelContext13CuDeviceArrayI7Float64Ll1ELl1EE11BroadcastedI12CuArrayStyleILl1E12DeviceMemoryE5TupleI5OneToI5Int64EE1_S 0.06%4.9 ms │  15113.24 µs ± 0.16   (  2.623.81)   │ partial_mapreduce_grid(identity, _, Bool, CartesianIndices<2l, Tuple<OneTo<Int64>, OneTo<Int64>>>, CartesianIndices<2l, Tuple<One 0.06%4.66 ms │  15113.08 µs ± 0.52   (  2.385.48)   │ _34(CuKernelContext, CuDeviceArray<Bool, 1l, 1l>, Broadcasted<CuArrayStyle<1l, DeviceMemory>, Tuple<OneTo<Int64>>, _19<CuArraySty 0.06%4.65 ms │   25218.47 µs ± 4.2    (  12.423.37)  │ void cusparse::csrmv_v3_kernel<std::integral_constant<bool, false>, int, int, double, double, double, double, void>(cusparse::Ker 0.06%4.51 ms │   35512.72 µs ± 2.46   (  7.1515.74)  │ partial_mapreduce_grid(identity, max, Float64, CartesianIndices<1l, Tuple<OneTo<Int64>>>, CartesianIndices<1l, Tuple<OneTo<Int64> 0.05%4.26 ms │    9246.26 µs ± 1.98   ( 43.3949.35)  │ _Z10map_kernel15CuKernelContext13CuDeviceArrayI7Float64Ll1ELl1EE11BroadcastedI12CuArrayStyleILl1E12DeviceMemoryE5TupleI5OneToI5In 0.04%2.99 ms │    5554.39 µs ± 0.31   ( 53.6455.07)  │ void cudss::copy_matrix_ker<long, double, int, 128>(int, int const*, long const*, double const*, double*, int)                    0.04%2.86 ms │   5515.18 µs ± 2.01   (  1.199.3)    │ _6(CuKernelContext, CuDeviceArray<Float64, 1l, 1l>, Float64)                                                                      0.03%2.79 ms │   8453.3 µs ± 0.39   (  2.624.77)   │ getindex_kernel(CuKernelContext, CuDeviceArray<Float64, 1l, 1l>, CuDeviceArray<Float64, 1l, 1l>, Tuple<Int64>, CuDeviceArray<CuDe 0.03%2.79 ms │   25311.01 µs ± 6.02   (  4.7719.79)  │ void axpy_kernel_val<double, double>(cublasAxpyParamsVal<double, double, double>)    

@amontoison
Copy link
Member Author

amontoison commented Jan 15, 2025

Note that I got this error when I wanted to check the Jacobian on GPU:

julia> jac(exa2, exa2.meta.x0)
ERROR: GPU compilation of MethodInstance for ExaModelsKernelAbstractions.gpu_kerj(::KernelAbstractions.CompilerMetadata{…}, ::Vector{…}, ::Vector{…}, ::ExaModels.SIMDFunction{…}, ::CuDeviceVector{…}, ::Nothing, ::Float64) failed
KernelError: passing and using non-bitstype argument

Argument 3 to your kernel function is of type Vector{Int64}, which is not isbits:
  .ref is of type MemoryRef{Int64} which is not isbits.
    .mem is of type Memory{Int64} which is not isbits.


Stacktrace:
  [1] check_invocation(job::GPUCompiler.CompilerJob)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/validation.jl:92
  [2] macro expansion
    @ ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:92 [inlined]
  [3] macro expansion
    @ ~/.julia/packages/TimerOutputs/6KVfH/src/TimerOutput.jl:253 [inlined]
  [4] codegen(output::Symbol, job::GPUCompiler.CompilerJob; toplevel::Bool, libraries::Bool, optimize::Bool, cleanup::Bool, validate::Bool, strip::Bool, only_entry::Bool, parent_job::Nothing)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:90
  [5] codegen
    @ ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:82 [inlined]
  [6] compile(target::Symbol, job::GPUCompiler.CompilerJob; kwargs::@Kwargs{})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:79
  [7] compile
    @ ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:74 [inlined]
  [8] #1145
    @ ~/.julia/packages/CUDA/2kjXI/src/compiler/compilation.jl:250 [inlined]
  [9] JuliaContext(f::CUDA.var"#1145#1148"{GPUCompiler.CompilerJob{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams}}; kwargs::@Kwargs{})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:34
 [10] JuliaContext(f::Function)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/driver.jl:25
 [11] compile(job::GPUCompiler.CompilerJob)
    @ CUDA ~/.julia/packages/CUDA/2kjXI/src/compiler/compilation.jl:249
 [12] actual_compilation(cache::Dict{…}, src::Core.MethodInstance, world::UInt64, cfg::GPUCompiler.CompilerConfig{…}, compiler::typeof(CUDA.compile), linker::typeof(CUDA.link))
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/execution.jl:237
 [13] cached_compilation(cache::Dict{Any, CuFunction}, src::Core.MethodInstance, cfg::GPUCompiler.CompilerConfig{GPUCompiler.PTXCompilerTarget, CUDA.CUDACompilerParams}, compiler::Function, linker::Function)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/2CW9L/src/execution.jl:151
 [14] macro expansion
    @ ~/.julia/packages/CUDA/2kjXI/src/compiler/execution.jl:380 [inlined]
 [15] macro expansion
    @ ./lock.jl:273 [inlined]
 [16] cufunction(f::typeof(ExaModelsKernelAbstractions.gpu_kerj), tt::Type{Tuple{…}}; kwargs::@Kwargs{always_inline::Bool, maxthreads::Nothing})
    @ CUDA ~/.julia/packages/CUDA/2kjXI/src/compiler/execution.jl:375
 [17] macro expansion
    @ ~/.julia/packages/CUDA/2kjXI/src/compiler/execution.jl:112 [inlined]
 [18] (::KernelAbstractions.Kernel{…})(::Vector{…}, ::Vararg{…}; ndrange::Int64, workgroupsize::Nothing)
    @ CUDA.CUDAKernels ~/.julia/packages/CUDA/2kjXI/src/CUDAKernels.jl:103
 [19] Kernel
    @ ~/.julia/packages/CUDA/2kjXI/src/CUDAKernels.jl:89 [inlined]
 [20] sjacobian!
    @ ~/.julia/packages/ExaModels/CGCQ6/ext/ExaModelsKernelAbstractions.jl:504 [inlined]
 [21] _jac_structure!(backend::CUDABackend, cons::ExaModels.Constraint{ExaModels.Constraint{…}, ExaModels.SIMDFunction{…}, CuArray{…}, Int64}, rows::Vector{Int64}, cols::Vector{Int64})
    @ ExaModelsKernelAbstractions ~/.julia/packages/ExaModels/CGCQ6/ext/ExaModelsKernelAbstractions.jl:175
 [22] jac_structure!
    @ ~/.julia/packages/ExaModels/CGCQ6/ext/ExaModelsKernelAbstractions.jl:170 [inlined]
 [23] jac_structure
    @ ~/.julia/packages/NLPModels/uC4QP/src/nlp/api.jl:171 [inlined]
 [24] jac(nlp::ExaModel{Float64, CuArray{…}, ExaModelsKernelAbstractions.KAExtension{…}, ExaModels.Objective{…}, ExaModels.Constraint{…}}, x::CuArray{Float64, 1, CUDA.DeviceMemory})
    @ NLPModels ~/.julia/packages/NLPModels/uC4QP/src/nlp/api.jl:271
 [25] top-level scope
    @ REPL[33]:1
Some type information was truncated. Use `show(err)` to see complete types.

I was still able to compute it on CPU and we have this sparsity pattern:
Capture d’écran du 2025-01-15 09-34-13
I can form J' * J in less than one second but J * J' takes a very long time so a part of this matrix is completely dense.

@jbcaillau Does it make sense to reformulate the problem to avoid a dense column or / and use a different KKT formulation?

@amontoison
Copy link
Member Author

amontoison commented Jan 15, 2025

I confirm that it's the culprit!

Capture d’écran du 2025-01-15 09-51-38
Capture d’écran du 2025-01-15 09-51-56

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

No branches or pull requests

3 participants