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

Scalar indexing when using GPU #277

Closed
Moelf opened this issue Feb 3, 2025 · 2 comments
Closed

Scalar indexing when using GPU #277

Moelf opened this issue Feb 3, 2025 · 2 comments

Comments

@Moelf
Copy link
Contributor

Moelf commented Feb 3, 2025

Warning: Performing scalar indexing on task Task (runnable, started) @0x00007fe8fe4968b0.
│ Invocation of getindex resulted in scalar indexing of a GPU array.
│ This is typically caused by calling an iterating implementation of a method.
│ Such implementations *do not* execute on the GPU, but very slowly on the CPU,
│ and therefore should be avoided.
│ 
│ If you want to allow scalar iteration, use `allowscalar` or `@allowscalar`
│ to enable scalar iteration globally or for the operations in question.
└ @ GPUArraysCore ~/.julia/packages/GPUArraysCore/aNaXo/src/GPUArraysCore.jl:145

The training setup looks something like:

evotree_config = EvoTreeClassifier(;
        nrounds=num_round,
        eta=η,
        max_depth,
        min_weight=3.0,
        nbins=128,
    )

fit_evotree(evotree_config, dtrain;
            target_name="proc",
            fnames=string.(input_names),
            w_name="wgts",
            deval,
            metric=:logloss,
            print_every_n=5,
            verbosity=1,
            early_stopping_rounds, device="gpu")
@Moelf
Copy link
Contributor Author

Moelf commented Feb 4, 2025

metric=:logloss,

this is the problem, for classification, it needs to be :mlogloss -- perhaps this should throw an error?

@Moelf Moelf closed this as completed Feb 4, 2025
@jeremiedb
Copy link
Member

Yes I agree that it should have thrown an error.
Upcomnig release for v0.17 should fix this by having both the loss and metric baked right into in EvoTreeClassifier:

EvoTrees.jl/src/learners.jl

Lines 238 to 239 in 835d8a4

loss = :mlogloss
metric = :mlogloss

I'm hoping to have it release by next week.

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

2 participants