-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
.Net Processes - Map Step Feature #9339
base: main
Are you sure you want to change the base?
Conversation
…antic-kernel into processes-map-step
dotnet/src/Experimental/Process.LocalRuntime/LocalKernelProcessFactory.cs
Show resolved
Hide resolved
dotnet/src/Experimental/Process.UnitTests/KernelProcessSerializationTests.cs
Show resolved
Hide resolved
ProcessBuilder process = new(nameof(TestMapAsync)); | ||
|
||
ProcessStepBuilder computeStep = process.AddStepFromType<ComputeStep>(); | ||
ProcessMapBuilder mapStep = process.AddMapForTarget(new ProcessFunctionTargetBuilder(computeStep)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[brainstorming hypothetical scenario]
wondering if these 2[line 40-41] should be a single function? since compute is not actually used by the root process directly having it instantiated on the level computeStep
could in theory also be used as a regular step:
graph TD
root["root process"]-->map-->compute1["compute"]
root-->compute2["compute"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Ben and I were discussing this also. There is a case where an edge may be defined outside of the map-operation: https://github.com/microsoft/semantic-kernel/blob/processes-map-step/dotnet/src/Experimental/Process.UnitTests/Runtime.Local/LocalMapTests.cs#L295
graph TD
root["root process"]--N-->map
subgraph map
compute1["compute"]
end
compute1["compute"]--1-->orthogonal
compute1["compute"]--N-->union
root--extra/noharm-->compute2["compute"]
The other factor to consider is when the map operation is a subprocess...such a pattern would also result in being explicitly handled by the caller (first create sub-process, then associate with map). The difference for step is that the builders only allow creating one from the process builder...which in turn always adds it to the step collection of the process.
I'm am certainly open to exploring any potential improvements, but it also feels like we need to be careful to consider the breadth of patterns that make sense and avoid disrupting others that are useful.
FYI - I'll planning on spending some time exploring alternative patterns here...just want to be careful.
Motivation and Context
Fixes: #9193
Description
Map each value from a set to a map-operation and present the results as a set for potential reduction.
Includes:
ProcessMapBuilder
(Core)KernelProcessMap
/KernelProcessMapState
(Abstractions)LocalMap
(LocalRuntime)MapActor
(DaprRuntime)Features:
Follow-up:
Contribution Checklist