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

feat(dataflow): Use raw contents in joins if any message uses raw contents #4781

Merged
merged 4 commits into from
Apr 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package io.seldon.dataflow.kafka

import com.google.protobuf.kotlin.toByteString
import io.seldon.mlops.inference.v2.V2Dataplane
import java.lang.UnsupportedOperationException
import java.nio.ByteBuffer
import java.nio.ByteOrder

Expand Down Expand Up @@ -100,7 +101,9 @@ fun convertRequestToRawInputContents(request: V2Dataplane.ModelInferRequest): V2
.toList()
}.toByteArray()
}
DataType.FP16, // as data is stored as FP32 we treat the same. Its unclear if Triton would handdle this correctly though
DataType.FP16 -> { // as data is stored as FP32 we treat the same. Its unclear if Triton would handle this correctly though
agrski marked this conversation as resolved.
Show resolved Hide resolved
throw UnsupportedOperationException("FP16 is not presently supported in Pipeline joins")
agrski marked this conversation as resolved.
Show resolved Hide resolved
}
DataType.FP32 -> {
input.contents.fp32ContentsList.flatMap {
ByteBuffer
Expand Down Expand Up @@ -136,7 +139,7 @@ fun convertRequestToRawInputContents(request: V2Dataplane.ModelInferRequest): V2
// Add raw contents
builder.addRawInputContents(v.toByteString())
// Clear the contents now we have added the raw inputs
builder.setInputs(idx, input.toBuilder().clearContents())
builder.getInputsBuilder(idx).clearContents()
}
return builder.build()
}
Expand Down Expand Up @@ -230,7 +233,9 @@ fun convertResponseToRawOutputContents(request: V2Dataplane.ModelInferResponse):
.array().toList()
}.toByteArray()
}
DataType.FP16, // Unclear if this is correct as will be stored as 4 byte floats so Triton may not handle this
DataType.FP16 -> { // as data is stored as FP32 we treat the same. Its unclear if Triton would handle this correctly though
throw UnsupportedOperationException("FP16 is not presently supported in Pipeline joins")
}
DataType.FP32 -> {
output.contents.fp32ContentsList.flatMap {
ByteBuffer
Expand Down Expand Up @@ -266,7 +271,7 @@ fun convertResponseToRawOutputContents(request: V2Dataplane.ModelInferResponse):
// Add raw contents
builder.addRawOutputContents(v.toByteString())
// Clear the contents now we have added the raw outputs
builder.setOutputs(idx, output.toBuilder().clearContents())
builder.getOutputsBuilder(idx).clearContents()
}
return builder.build()
}
Expand Down