Skip to content

Comments

Jvm inplace predict#9

Merged
yoquinjo merged 7 commits intosovrn:sovrn-inplace-predict-javafrom
trivialfis:jvm-inplace-predict
Aug 21, 2023
Merged

Jvm inplace predict#9
yoquinjo merged 7 commits intosovrn:sovrn-inplace-predict-javafrom
trivialfis:jvm-inplace-predict

Conversation

@trivialfis
Copy link

@trivialfis trivialfis commented Aug 7, 2023

@yoquinjo Could you please take a look? This is a draft of the changes needed to use the internal inplace predict function based on your existing patch.

  • Use the PredictFromDense function to implement inplace prediction, which doesn't make a data copy.

@trivialfis
Copy link
Author

trivialfis commented Aug 7, 2023

I haven't tested whether the JVM environment is thread-safe. The previous attempt with DMatrix got a race somewhere in the JVM data iterator with spark.

I'm not an expert in Java, the ideal case for prediction to return is to have an array/tensor with proper shape, which can be calculated from the C function. But since the Java land doesn't have a de-facto array implementation, a plain array is returned instead.

I might not be able to finish the full PR, feel free to merge if you find it useful.

@yoquinjo yoquinjo merged commit 8b4885d into sovrn:sovrn-inplace-predict-java Aug 21, 2023
@trivialfis trivialfis deleted the jvm-inplace-predict branch August 21, 2023 18:36
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.

2 participants