-
Notifications
You must be signed in to change notification settings - Fork 299
intrinsic-test
: Adding x86 behavioural testing.
#1894
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
base: master
Are you sure you want to change the base?
intrinsic-test
: Adding x86 behavioural testing.
#1894
Conversation
41db5a8
to
5fc0f3b
Compare
match str::parse::<u32>(etype_processed.as_str()) { | ||
Ok(value) => data.bit_len = Some(value), | ||
Err(_) => { | ||
data.bit_len = match data.kind() { | ||
TypeKind::Char(_) => Some(8), | ||
TypeKind::BFloat => Some(16), | ||
TypeKind::Int(_) => Some(32), | ||
TypeKind::Float => Some(32), | ||
_ => None, | ||
}; | ||
} | ||
} |
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.
why are only some type kinds covered here? Maybe this could be a method on TypeKind
?
9e28106
to
111cd5d
Compare
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.
you should rebase on top of the upstream master branch instead of merging it in. That keeps the git history clean.
x86_64-unknown-linux-gnu*) | ||
CPPFLAGS="${TEST_CPPFLAGS}" RUSTFLAGS="${HOST_RUSTFLAGS}" RUST_LOG=warn \ | ||
cargo run "${INTRINSIC_TEST}" "${PROFILE}" \ | ||
--bin intrinsic-test -- intrinsics_data/x86-intel.xml \ | ||
--runner "${TEST_RUNNER}" \ | ||
--cppcompiler "${TEST_CXX_COMPILER}" \ | ||
--target "${TARGET}" | ||
;; |
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.
we'll have to see how to do this exactly, but we want to split these out of the main CI job to speed it up
f3f87f2
to
2ec747c
Compare
2ec747c
to
a8313d0
Compare
Seems like the CI run at this point failed due to this error. I'll retry shortly:
|
126a3ce
to
e79129a
Compare
Can you rebase this (and remove the merge commits) sometime? That would make it a lot easier to see what has actually changed. Also, why do you push to then have CI fail? Running this locally is a lot faster than having CI do it, because you can skip the earlier steps and run just the intrinsic tests. |
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.
oh, wait, it probably is up to date? it's just that xml file is enormous. that's crazy. Should we like, try to trim that down?
@folkertdev I've been syncing using the below command whenever I'm updating from master: git rebase master Am I doing it correctly? |
About the XML file specification, may I ask what "trim down" means? |
depends a bit on your git setup, but it seems to work allright. I was just confused by the enormous number of lines changed, but that's all due to that XML file. |
What i mean is, could we process that XML file into a smaller XML file that only stores what we need? That would reduce the size of the repo (not sure how big that file is, maybe it compresses well?) and the speed of the intrinsic tests. There are risks too, e.g. what we generate could go out of date with the official XML file. So maybe it's fine this way. |
Ahh, makes sense. I think it might be best to keep the source of truth as unchanged as possible, since there is no direct way to obtain the sources sometimes. For example, the XML file originally existed in the The entire XML data can be found stored as a hardcoded string that is assigned to a variable in a JS file. |
variants for compatibility with the Rust version
c9ea3bd
to
18aed56
Compare
18aed56
to
5162772
Compare
@folkertdev I've added the ability to sample intrinsics. Currently it's implemented for x86 and about 5% of intrinsics are randomly chosen for testing. This is intended as a temporary solution really, we can remove it once we restructure the C++/Rust testfiles to run all intrinsics in one go. |
Neat! So, this does increase the longest CI job to 20 minutes, up from 12 minutes. I think we should try to make this its own CI job at least. I'm also not sure that we want to randomly sample the tests on each run. If we do hit a failure, that will be hard to reproduce. The status quo is no testing at all, so I think testing even a fixed subset is an improvement.
did this happen? It still looks like the file is added again here. |
Ohh no, let me do that too. |
About the hit failure, hmm yes you have a point. |
to char 2. including variable names in template strings instead of passing them as arguments to macros
I'll need to rename the variables in |
524bc52
to
6df5eca
Compare
Okay, so I've split the Now the longest process among all the CI processes, is the |
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.
I think this looks good, but the CI changes are quite large, so could you split those out into their own PR (and then just add the x86 stuff here)?
ci/run.sh
Outdated
PATH="$PATH":"$(pwd)"/c_programs | ||
export PATH |
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.
why is this needed? it really should not be I think?
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.
Okay, so it turns out that for aarch64, qemu
's executable resolution algorithm looks into the current directory too.
However, sde64
looks only at PATH.
This was intended to fix that discrepancy, but now that I think about it, it might be cleaner to use ./intrinsic-test-programs
in compare_outputs.rs
.
6df5eca
to
1abb103
Compare
uint16_t temp = 0; | ||
memcpy(&temp, &value, sizeof(float16_t)); | ||
std::stringstream ss; | ||
ss << "0x" << std::setfill('0') << std::setw(4) << std::hex << temp; | ||
os << ss.str(); | ||
return os; | ||
} |
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.
@folkertdev do we need stringstream here? Seems to me that we can make this definition shorter.
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.
My c++ is not good enough to know for sure. If there is something shorter that works I'm all for it
} | ||
} | ||
|
||
pub fn chunk_info(intrinsic_count: usize) -> (usize, usize) { |
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.
I'll need to remove this, since we aren't using this.
The CI processes on x86 broke bcoz of RAM resource constraints.
Okay, so I've reverted that last one commit (that split the CI job) and the PATH update. |
Maybe this was not clear but my intention was to merge the ci changes separately first, them rebase this pr on top |
Ohh ohh, my bad. Created a PR for that: #1941 |
Turns out |
212e16d
to
1abb103
Compare
Context
This is a redo of PR #1814, since a lot of details have changed with PRs #1863, #1862, #1861, #1852.
r? @folkertdev
cc: @Amanieu