Skip to content

Update types for CTK 13.3#12230

Merged
trivialfis merged 3 commits into
dmlc:masterfrom
jakirkham:fix_cuda_13.3_bld
Jun 4, 2026
Merged

Update types for CTK 13.3#12230
trivialfis merged 3 commits into
dmlc:masterfrom
jakirkham:fix_cuda_13.3_bld

Conversation

@jakirkham

@jakirkham jakirkham commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #12229

CUDA 13.3 builds fail due to...

  • Missing template from emplace method call
  • Issue deducing decltype of member value (inlined result)

Comment thread src/encoder/ordinal.cuh Outdated
std::vector<decltype(mapping)::value_type> h_mapping(mapping.size());
thrust::copy_n(dh::tcbegin(mapping), mapping.size(), h_mapping.begin());
std::vector<decltype(new_enc.feature_segments)::value_type> h_feature_segments(
std::vector<std::int32_t> h_feature_segments(

@jakirkham jakirkham Jun 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC new_enc is defined as DeviceColumnsView

Span<std::int32_t const> sorted_idx, DeviceColumnsView new_enc,

DeviceColumnsView is just shorthand for ColumnsViewImpl<DeviceCatIndexView>

using DeviceColumnsView = detail::ColumnsViewImpl<DeviceCatIndexView>;

When looking at ColumnsViewImpl<DeviceCatIndexView>, it defines feature_segments as std::int32_t const. Think the const being passed to std::vector is what is causing the compilation error

template <typename Variant>
struct ColumnsViewImpl {
using VariantT = Variant;
Span<Variant const> columns;
// Segment pointer for features, each segment represents the number of categories in a feature.
Span<std::int32_t const> feature_segments;

Am curious, how is const being used here?

Edit: Providing more context on how I'm reading the code

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also try std::decay_t if you want to keep decltype and avoid hardcoding the type.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC the value_type is trying to remove const here:

class Span {
public:
using element_type = T; // NOLINT
using value_type = typename std::remove_cv<T>::type; // NOLINT

Though that doesn't seem to be reflected in the compiler error we get.

@jakirkham

Copy link
Copy Markdown
Contributor Author

Only C++ code was changed. So the Python lint issues should be unrelated.

Recently scikit-learn released 1.9.0, so an upstream change may explain the Python test failure.

In any case, these appear to be unrelated failures.

@trivialfis

Copy link
Copy Markdown
Member

Created a pr here: #12232

I think it's a bug in the compiler.

@jakirkham jakirkham changed the title Update types for CTK 13.4 Update types for CTK 13.3 Jun 4, 2026
Comment thread src/data/cat_container.cu
auto dispatch = enc::Overloaded{
[this, f_idx, &h_columns_v, stream](enc::CatStrArrayView const& str) {
this->columns[f_idx].emplace<CatStrArray>();
this->columns[f_idx].template emplace<CatStrArray>();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jiaming! 🙏

We still need these template lines too. Could you please add them in your PR?

@trivialfis

Copy link
Copy Markdown
Member

Let me know if you want me to merge or you have more pending changes in mind.

@jakirkham

Copy link
Copy Markdown
Contributor Author

Thanks Jiaming! 🙏

These changes look reasonable to me. Nothing further to add.

Please feel free to merge when you are ready.

@trivialfis
trivialfis merged commit b835912 into dmlc:master Jun 4, 2026
81 checks passed
@jakirkham
jakirkham deleted the fix_cuda_13.3_bld branch June 6, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failing with CUDA 13.3 (conda-forge)

4 participants