-
Notifications
You must be signed in to change notification settings - Fork 38
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
Implement Hyperrun #838
Implement Hyperrun #838
Conversation
Hi @dachengx this PR looks good to me, but I'm a little bit confused:
|
I will write a test module for this PR. Sorry, actually this PR is not fully ready. In the test, I will show how hyperruns and superruns are different. |
@yuema137 the test is added |
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.
Hi @dachengx, I read the changes carefully, and now I think I understand this much better:
- In
get_components
, the treatment for hyperrun is actually similar to normal runs, which means there is only a single loader. For superruns a loader is defined for each subrun. - And the difference is that for hyperruns more checks are done to guarantee that the targets to load satisfy the requirements for hyperruns.
- Therefore the hyperrun is precisely equivalent to a single run in the view of strax/straxen. So when you use the exhaust plugins, the processor will regard several runs as a single one and give you the whole chunk. But for normal plugins, there should not be a difference.
The test works fine for me. Please merge it if my understanding is correct. Otherwise please let me know.
Thanks for this hyper interesting PR. Although I cannot follow the code, based on my understanding in the test case, we always need |
@zihaoxu98 The purpose of Hyperrun is to let strax regard the runlist as a single run (for super run it's not the case as strax still treats them as separate runs). It doesn't make observable changes for normal plugins because the data is still chunked, and the computation is done chunk by chunk. |
What is the problem / what does the code in this PR do
Hyperruns. Hyperruns are superruns, also processing of hyperruns depends on
run_metadata
defined similarly to https://straxen.readthedocs.io/en/latest/tutorials/SuperrunsExample.html#Define-a-superrun:.If a hyperrun has run_id
__000000
, theplugin.run_id
of the plugins used in processing will be000000
, and the subruns of the hyperrun will be mixed(concatenated) while processing.A new attribute
allow_hyperrun
ofstrax.Plugin
class is added. Theallow_hyperrun
ofdata_type
depends on thedata_type
whoseallow_hyperrun
isTrue
can only beTrue
. So this means, your father isTrue
, so you must beTrue
.Can you briefly describe how it works?
The key feature of hyperrun is that the chunks of subruns can be loaded together.
For superruns, the subruns are still made and loaded separately. For hyperrun, we can really treat the combination of subruns as a single run in the context of processing.
For example, in the added test., the data_type
sum
deepens onranges
. The"data"
inranges
are just sequence of numbers in order with an offset, like[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
and[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
. Thesum
will sum the"data"
inranges
byranges["data"] + ranges["data"][::-1]
, so you will get[0] * 10
or[29] * 10
.Frist, note that we will have 3 runs. And the
"data"
in theranges
of 3 subruns are assigned to be[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
,[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
, and[20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
sum
is from a superrun, thesum
will be[9] * 10 + [29] * 10 + [49] * 10
. Just because the subruns will still be calculated separately.sum
is from a hyperrun, thesum
will be[29] * 30
. Because the subruns will still be first combined into"data"
whose length is 30, thenranges["data"] + ranges["data"][::-1]
run. So the subruns are really loaded as if they are the same run.Can you give a minimal working example (or illustrate with a figure)?
The example is in the added test.
Please include the following if applicable:
Please make sure that all automated tests have passed before asking for a review (you can save the PR as a draft otherwise).