-
Notifications
You must be signed in to change notification settings - Fork 291
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
evalv3 performance on cycles #3517
Comments
Assigning to myself to attempt to reduce this a bit further. As of 860906a, evalv2 seems to give an error similar to #3511, although that was an evalv3 regression, and not an error that evalv2 would give:
The new evaluator seems to want to consume all of my available RAM, so I killed it before it managed to do that. It was using about 30GiB of RAM when I kille dit. |
@b4nst what exactly are you running? With
You can run this with https://pkg.go.dev/github.com/rogpeppe/go-internal/cmd/testscript. |
Oh sorry, thought I did put the command. I'm running When doing an export like you did, without CUE_EXPERIMENT set to |
OK thank you. Is there a particular reason you would usually Is there a |
I'll try to provide a reproducible example without leaking too much details, but basically yeah we do use export eventually. The configuration is humongous tho, this was a short example that helped reproducing the error we're currently facing. To give a little bit of context, in our use case some of the data is user provided (as tag, or input file). Some of that input ends up in one of a TimeSpan |
Understood, thank you.
If you would be able to share this with us, either as a reduced/simplified example you can share publicly, or sharing privately with me or via https://cuelabs.dev/unity/, that would be really helpful. In the meantime, I'll try to reduce the |
Thanks a lot! I'll work tomorrow on a reproducible example we can put on the unity project. It'll help me cutting the refactor down anyway. |
Ok I think I can validate the behaviour with that example and export. Basically by adding env CUE_EXPERIMENT=evalv3
exec time -l cue export -e ts
-- main.cue --
package p
#TimeSpan: {
start: float
duration: float
end: float
start: end - duration
duration: end - start
end: start + duration
start: <=end
}
#Task: {
action: string
timeSpan: #TimeSpan
}
#TaskSet: {
action: string
#tasks: [string]: #Task
tasks: [for _, v in #tasks {v}]
tasks: [...#Task]
timeSpan?: #TimeSpan
}
#T1: #Task & {
action: "Task 1"
timeSpan: #TimeSpan & {
duration: 4.2
}
}
#T2: #Task & {
action: "Task 2"
timeSpan: #TimeSpan & {
duration: 120.0
}
}
ts: #TaskSet
ts: this={
action: "Task 1 and Task 2"
#tasks: {
t1: #T1 & {
timeSpan: end: this.#tasks.t2.timeSpan.start
}
t2: #T2 & {
timeSpan: end: this.timeSpan.end
}
}
timeSpan: start: this.#tasks.t1.timeSpan.start
}
ts: timeSpan: end: 100.0 0.02 real 0.02 user 0.00 sys
21364736 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
1569 page reclaims
3 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
33 signals received
39 voluntary context switches
222 involuntary context switches
153678554 instructions retired
62430448 cycles elapsed
11503104 peak memory footprint Our issue comes when there is a cycle error. evalv2 can detect it, although showing significantly worst performances than without the error: ts: cycle error
0.50 real 0.62 user 0.02 sys
52264960 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
3459 page reclaims
2 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
707 signals received
544 voluntary context switches
2150 involuntary context switches
9502462162 instructions retired
2105547898 cycles elapsed
39781952 peak memory footprint With evalv3 on the other hand, I can't get it to raise the cycle error. The process starts eating all my memory. So our problem can be summarized as:
On another note, our legal team is currently looking into the unity project policies. So hopefully we'll soon be allowed to share more concrete examples of those situations. Thanks again for all your help, it is really aprecciated! |
Hey, just for information I can reproduce the same error with |
What version of CUE are you using (
cue version
)?Does this issue reproduce with the latest stable release?
Yes
What did you do?
When evaluating that example
performance without
evalv3
:0.29 real 0.31 user 0.03 sys 51806208 maximum resident set size 0 average shared memory size 0 average unshared data size 0 average unshared stack size 2797 page reclaims 645 page faults 0 swaps 0 block input operations 0 block output operations 0 messages sent 0 messages received 626 signals received 561 voluntary context switches 2136 involuntary context switches 4477669464 instructions retired 1141032608 cycles elapsed 35964416 peak memory footprint
with
evalv3
:26.65 real 28.49 user 19.72 sys 5464260608 maximum resident set size 0 average shared memory size 0 average unshared data size 0 average unshared stack size 4601153 page reclaims 11 page faults 0 swaps 0 block input operations 0 block output operations 0 messages sent 0 messages received 49995 signals received 23226 voluntary context switches 1507128 involuntary context switches 533667430315 instructions retired 149088659879 cycles elapsed 31108296192 peak memory footprint
What did you expect to see?
Similar (or better) performance (both memory & time) with new evalv3 algorithm.
What did you see instead?
Significantly worth performances than the previous algorithm.
Notes
This might be related to #3208.
Also,
#TaskSet.tasks
sounds like the trouble maker here. When removing that part of the definition, it's back to nominal.The text was updated successfully, but these errors were encountered: