-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[BYOC][ETHOSN] Introduce further operator support #6355
Conversation
@tqchen could you advise on what to do about the failing build? It seems one of the docker images doesn't have tensorflow available, so is there a way we can avoid running the tests there? |
@@ -120,6 +120,14 @@ Module EthosnModule::LoadFromBinary(void* strm) { | |||
return Module(n); | |||
} | |||
|
|||
void EthosnModule::SaveToFile(const std::string& path, const std::string& format) { |
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.
It looks me that this still saves a binary file. Are there specific use cases?
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.
It's used by assert_lib_hash in the test infrastructure. See my comment further down on the purpose of the hashes.
"models/mobilenet_v1_2018_08_02/mobilenet_v1_1.0_224_quant.tgz", | ||
model_sub_path="mobilenet_v1_1.0_224_quant.tflite", | ||
input_dict={"input": (1, 224, 224, 3)}, | ||
compile_hash="81637c89339201a07dc96e3b5dbf836a", |
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.
How this hash comes from? In case someone in the future changes Ethos-N codegen, how can this be updated?
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.
This is created by hashing the library output we get when compiling the model. We create the hash at a 'known good' point in time (i.e. when we run the HW tests internally and see everything is correct). The thinking here is that this provides a quick way to test whether changes in TVM have resulted in a behavioural change to our codegen.
We will remain responsible for updating these hashes while no public hardware is available. Should it become available, we'll no longer need the hashes as we can just test execution correctness directly.
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 see. Could you comment this on the code with TODO? Thanks.
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've added in a comment rather than a TODO because I don't think this represents work that is yet to be done, but rather maintenance procedure. It explains the purpose of the hash and who to contact (myself and @Leo-arm ) should the test fail.
LGTM |
return EthosnError(); | ||
} | ||
|
||
EthosnError ConstructNetworkVisitor::MakeReluLayer(const Call& call, |
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.
Just a minor suggestion that you feel free to ignore, I think these functions can be replaced by a macro as they look exactly the same and only operator name matters.
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 we won't reimplement this for now, but there are subtle differences between these functions, mostly around the number and type of the inputs/outputs + how quantization params should be handled.
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.
Approved with concerns. Ideally, we hope everyone could jump in to maintain and improve a module if they have an interest. The current unit tests, however, can only be maintained by specific folks. I'll let others comment.
This is an unfortunate consequence of the lack of hardware availability in CI. While that isn't available, it will necessarily be the case that we (Arm) need to maintain this code. I don't believe this is uncommon with new hardware in open source projects. |
@mbaret can you rebase? |
'Black' has definitely decreased the readability of some of our tests quite considerably. Might have been worth having tests be exempt... |
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.
revert the vta changes
This PR introduces support for the following operators: - Quantized Fully Connected - Quantized Addition - Depth-to-space - Max/Avg Pool 2D - Quantized Relu (Clip) - Reshape - Quantized Sigmoid Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
Change-Id: I11bcf4a78014fa63e7b8e3b0cb00eecfd6cb7760
Change-Id: I1fb1a11d0765f6d69f04c24b9c24e08665b8af6a
Change-Id: Id06063a0a0cf5f01356df23dc5d4bbbcb47cfa99
Change-Id: I330408dfabc4bd804373f100581ce909ff724052
Change-Id: I2c5007be485b323116a0e8bab0f9106ea5ec834b
Change-Id: I13828c918c959daa492b9ed942a882c86d6690d1
Change-Id: Idaa70ab9c2ec8db2828d51d15e7c23f28670ec82
Change-Id: I538171bd547a16395bef155a1dad28e8b3e347f2
vta change reverted |
Thanks everyone! |
Thanks for all the reviews everyone :) |
* [BYOC][ETHOSN] Introduce further operator support This PR introduces support for the following operators: - Quantized Fully Connected - Quantized Addition - Depth-to-space - Max/Avg Pool 2D - Quantized Relu (Clip) - Reshape - Quantized Sigmoid Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * Skip tf imports if not available Change-Id: I11bcf4a78014fa63e7b8e3b0cb00eecfd6cb7760 * ethos -> ethosn Change-Id: I1fb1a11d0765f6d69f04c24b9c24e08665b8af6a * Reduce random testing in test_addition Change-Id: Id06063a0a0cf5f01356df23dc5d4bbbcb47cfa99 * Reduce random testing in test fullyconnected Change-Id: I330408dfabc4bd804373f100581ce909ff724052 * Fix dumb mistake with rename Change-Id: I2c5007be485b323116a0e8bab0f9106ea5ec834b * Added comments to update the hashes in network tests when necessary Change-Id: I13828c918c959daa492b9ed942a882c86d6690d1 * Fix github name Change-Id: Idaa70ab9c2ec8db2828d51d15e7c23f28670ec82 * Use black formatting Change-Id: I538171bd547a16395bef155a1dad28e8b3e347f2 Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* [BYOC][ETHOSN] Introduce further operator support This PR introduces support for the following operators: - Quantized Fully Connected - Quantized Addition - Depth-to-space - Max/Avg Pool 2D - Quantized Relu (Clip) - Reshape - Quantized Sigmoid Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * Skip tf imports if not available Change-Id: I11bcf4a78014fa63e7b8e3b0cb00eecfd6cb7760 * ethos -> ethosn Change-Id: I1fb1a11d0765f6d69f04c24b9c24e08665b8af6a * Reduce random testing in test_addition Change-Id: Id06063a0a0cf5f01356df23dc5d4bbbcb47cfa99 * Reduce random testing in test fullyconnected Change-Id: I330408dfabc4bd804373f100581ce909ff724052 * Fix dumb mistake with rename Change-Id: I2c5007be485b323116a0e8bab0f9106ea5ec834b * Added comments to update the hashes in network tests when necessary Change-Id: I13828c918c959daa492b9ed942a882c86d6690d1 * Fix github name Change-Id: Idaa70ab9c2ec8db2828d51d15e7c23f28670ec82 * Use black formatting Change-Id: I538171bd547a16395bef155a1dad28e8b3e347f2 Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
* [BYOC][ETHOSN] Introduce further operator support This PR introduces support for the following operators: - Quantized Fully Connected - Quantized Addition - Depth-to-space - Max/Avg Pool 2D - Quantized Relu (Clip) - Reshape - Quantized Sigmoid Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com> * Skip tf imports if not available Change-Id: I11bcf4a78014fa63e7b8e3b0cb00eecfd6cb7760 * ethos -> ethosn Change-Id: I1fb1a11d0765f6d69f04c24b9c24e08665b8af6a * Reduce random testing in test_addition Change-Id: Id06063a0a0cf5f01356df23dc5d4bbbcb47cfa99 * Reduce random testing in test fullyconnected Change-Id: I330408dfabc4bd804373f100581ce909ff724052 * Fix dumb mistake with rename Change-Id: I2c5007be485b323116a0e8bab0f9106ea5ec834b * Added comments to update the hashes in network tests when necessary Change-Id: I13828c918c959daa492b9ed942a882c86d6690d1 * Fix github name Change-Id: Idaa70ab9c2ec8db2828d51d15e7c23f28670ec82 * Use black formatting Change-Id: I538171bd547a16395bef155a1dad28e8b3e347f2 Co-authored-by: Leo Blonk <Leo.Blonk@arm.com> Co-authored-by: Tristan O'Connor <tristan.oconnor@arm.com> Co-authored-by: Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
This PR introduces support for the following operators via the Ethos-N codegen:
Additionally, tests for mobilenet, inceptionv3/4 and ssd mobilenet are added.
Co-authored-by: Leo Blonk Leo.Blonk@arm.com
Co-authored-by: Tristan O'Connor tristan.oconnor@arm.com
Co-authored-by: Ramana Radhakrishnan ramana.radhakrishnan@arm.com