-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update build scripts to always run tests for all MXNet engine types #71
base: v0.x.x
Are you sure you want to change the base?
Changes from 4 commits
0aa2462
62e2506
201fe10
9370ffd
38c3e08
c8d44c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,34 @@ endif | |
download-mnist: $C/script/download-mnist | ||
$(call exec,sh $(if $V,,-x) $^,$(MNIST_DATA_DIR),$^) | ||
|
||
# helper template to define targets for per-engine test runs | ||
define run_test_with_engine | ||
$(1).stamp: $(1)-$(2).stamp | ||
|
||
$(1)-$(2).stamp: $1 | ||
$(call exec,MXNET_ENGINE_TYPE=$2 $1,$1,$2) | ||
endef | ||
|
||
# helper function to generate targets for per-engine test runs | ||
test_with_engines = $(foreach engine,$2,\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably here we can drop |
||
$(eval $(call run_test_with_engine,$1,$(engine)))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both |
||
|
||
# extra build dependencies for integration tests | ||
$O/test-mxnet: override LDFLAGS += -lz | ||
$O/test-mxnet: override DFLAGS += -debug=MXNetHandleManualFree | ||
|
||
# run integration tests with all specified engines | ||
$(eval $(call test_with_engines,$O/test-mxnet,$(TEST_MXNET_ENGINES))) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It'd be nice to be able to simplify these lines. |
||
|
||
# extra runtime dependencies for integration tests | ||
$O/test-mxnet.stamp: override ITFLAGS += $(MNIST_DATA_DIR) | ||
$O/test-mxnet.stamp: download-mnist | ||
$Vtouch $@ # override default implementation | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This tweak (and the similar one for unittests) is necessary to avoid the "normal" integration test run from also taking place. Would be nice to avoid if possible though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another approach is to have the MXNet default engine always executed and then change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. It would probably be best in that case to remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would also avoid the need to override the default environment with lines like
... so it's probably better this way. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HOWEVER, note that this then messes up things from another point of view, which is: what if I want to specify just one engine to test with, not as an extra? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Obviously I can do |
||
|
||
$O/%unittests: override LDFLAGS += -lz | ||
|
||
# run unittests with all specified engines | ||
$(eval $(call test_with_engines,$O/allunittests,$(TEST_MXNET_ENGINES))) | ||
|
||
$O/allunittests.stamp: | ||
$Vtouch $@ # override default implementation |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
INTEGRATIONTEST := integrationtest | ||
|
||
TEST_MXNET_ENGINES ?= NaiveEngine ThreadedEngine ThreadedEnginePerDevice | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One small note here: it should not be possible that the
... then obviously, nothing runs. But there should be a failure in this case (which doesn't happen right now). Any thoughts on the best way to implement this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see why there should be a failure. Because with empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jens-mueller-sociomantic right now they are not ADDITIONAL targets. Of course, we could make it so. It just means that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps define the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nemanja-boric-sociomantic I'm not sure it really fixes the issue, because the problem is precisely if the user overrides the variable to set it to empty (a phony target won't solve that). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I was talking nonsense. Hm... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a way of defining default to be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH I think this is overthinking things. If someone sets the field to empty that's their problem ... |
||
|
||
MXNET_ENGINE_TYPE ?= NaiveEngine | ||
export MXNET_ENGINE_TYPE | ||
|
||
|
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.
Don't you miss a
$Vtouch $(1)-$(2).stamp
here?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.
Yes, most likely. I think I tried using
$@
and there was some objection to that (which I assume is about ordering of make's expansion of these tokens).