-
Notifications
You must be signed in to change notification settings - Fork 21
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
Seeding the matrix generator #54
Comments
Other ideas from SLATE meeting:
|
Personally, I would want the first idea to be an opt in feature. I almost always manually set the seed, about half my tests use (seed-less) structured matrices, and I often run tests where "FAILED" is expected (e.g., most tests with For the second idea, I was trying to basically achieve idea 3 with my suggestion, while retaining the ability for the user to directly control the seed. It is simply enough that the user can determine the seed with just elementary math. And, it allows setting the exact matrix for any position of any routine (assuming the other matrix params are also the same). An alternative could be something like A MATLAB interface to the generator would just be a simple MEX file, compiling |
The user doesn't readily know the number of matrices. gemm has 3 or 4, depending on how testing is done; other routines differ. If I'm not sure what you mean by "position". Do you mean setting the seed for A, B, C matrices, with positions 0, 1, 2, respectively? I was thinking to have one seed value per line, used for all matrices, including internal ones like gemm's check matrix, just incrementing between. Is that formula random enough? I.e., with this generator you don't need Range is brainstorming. Not sure how it would fit in. Also, something like |
Yea, my though was to not count the matrices that aren't part of the UI. So, GEMM's I think I agree that it'd be better to always use the same multiplier like
Yea, that's the numbering I was thinking about. I was just phrasing "take the seed for the first matrix in the line and increment after each matrix" in a more flexible way.
As a default that's probably fine, but I think it'd be better if there's an escape hatch that allows controlling the seed of A separately from the seed of B. That allows doing tests like
The tester doesn't consider U and V as having separate seeds.
As far as I can tell, yes. Changing any one bit in the seed should change about half of the bits used to generate the, e.g., A(1,1) element (with no particular pattern). Internally, it does a bunch of xors and 64x64 bit multiplications before making the float.
Yea, that definitely seems useful, especially in shell's that don't let you move the cursor with the mouse. |
Here's a revised proposal that I think addresses your concerns and mine. We add At program start // a timestamp or something
// should be printed in the header
// forced to the range (e.g.) [1, 2^62] to leave enough room at the top to add 100*line_no + position
int64_t base_seed = ...; To compute the actual seed to be used internally: uint64_t generate_real_seed(int64_t user_seed, int64_t line_no, int64_t position) {
if (user_seed == 0) user_seed = -1*base_seed;
if (user_seed < 0)
return uint64_t(-1*user_seed) + 100*line_no + position;
else
return uint64_t(user_seed) + position;
} Using just The one thing I don't like is that if you want to reuse the same matrix in a different position, you have to adjust the seed instead of just changinge |
I think I see a way to address the various desires for seeding the matrix generator.
The sign of the seed would control the behavior.
This should handle:
Matrix kinds
sectionThe big downside is that you'd need to count the number of previously generated matrices in the group if you want to run just a specific test. For the CholQR example, you'd have to count 12 lines times 3 matrices per line. Adding a "test number" column could help if this is a big concern. (Coping the output into a text edit is a quick and dirty way to count lines.)
We'd probably only want to increment the "matrix count" for matrices that get mentioned by the tester's interface (e.g., not the
X
matrix in GEMM's tester). Otherwise, you'd need to remember which cases have secret matrices.For printing the matrices in the tester, we can do something like
--seed 10
givingseed=10
--seed -10
givingseed=10+matrix count
--seed 0
givingseed=20230515113921+matrix count
which would result in 1 listing per user-provided seed (times the combinations of other matgen parameters).
If using the seed's sign seems too opaque, we could make a basic string syntax like the matrix kind.
The tester's existing timestamp might work well for the "global seed". It's already printed and easy to map to an integer. E.g.,
2023-05-15 11:39:21
becomes20230515113921
. It's only a 1-second resolution, but that'll still ensure a large variety of problems are tested.The text was updated successfully, but these errors were encountered: