Skip to content

Conversation

taivu1998
Copy link
Contributor

@taivu1998 taivu1998 commented Jul 27, 2020

Stack from ghstack:

Differential Revision: D22803740

@taivu1998 taivu1998 requested a review from apaszke as a code owner July 27, 2020 21:35
@taivu1998 taivu1998 mentioned this pull request Jul 27, 2020
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Jul 27, 2020
@taivu1998 taivu1998 requested a review from kimishpatel July 27, 2020 21:37
@dr-ci
Copy link

dr-ci bot commented Jul 27, 2020

💊 CI failures summary and remediations

As of commit da42c7c (more details on the Dr. CI page):


  • 4/5 failures possibly* introduced in this PR
    • 1/4 non-CircleCI failure(s)
  • 1/5 broken upstream at merge base c9dcc83 since Aug 12

🕵️ 3 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build caffe2_onnx_main_py3_6_clang7_ubuntu16_04_test (1/3)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

Aug 13 08:44:26 ERROR: No matching distribution found for ort-nightly==1.4.0.dev202007311
Aug 13 08:44:23 The directory '/var/lib/jenkins/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Aug 13 08:44:23 Collecting pip 
Aug 13 08:44:24   Downloading https://files.pythonhosted.org/packages/5a/4a/39400ff9b36e719bdf8f31c99fe1fa7842a42fa77432e584f707a5080063/pip-20.2.2-py2.py3-none-any.whl (1.5MB) 
Aug 13 08:44:24 Installing collected packages: pip 
Aug 13 08:44:24   Found existing installation: pip 9.0.1 
Aug 13 08:44:24     Uninstalling pip-9.0.1: 
Aug 13 08:44:24       Successfully uninstalled pip-9.0.1 
Aug 13 08:44:25 Successfully installed pip-20.2.2 
Aug 13 08:44:25 + pip install -q --user -i https://test.pypi.org/simple/ ort-nightly==1.4.0.dev202007311 
Aug 13 08:44:26 ERROR: Could not find a version that satisfies the requirement ort-nightly==1.4.0.dev202007311 (from versions: 1.4.0.dev202007271) 
Aug 13 08:44:26 ERROR: No matching distribution found for ort-nightly==1.4.0.dev202007311 

See CircleCI build caffe2_onnx_ort1_py3_6_clang7_ubuntu16_04_test (2/3)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

Aug 13 08:47:35 ERROR: No matching distribution found for ort-nightly==1.4.0.dev202007311
Aug 13 08:47:32 The directory '/var/lib/jenkins/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Aug 13 08:47:33 Collecting pip 
Aug 13 08:47:33   Downloading https://files.pythonhosted.org/packages/5a/4a/39400ff9b36e719bdf8f31c99fe1fa7842a42fa77432e584f707a5080063/pip-20.2.2-py2.py3-none-any.whl (1.5MB) 
Aug 13 08:47:33 Installing collected packages: pip 
Aug 13 08:47:33   Found existing installation: pip 9.0.1 
Aug 13 08:47:33     Uninstalling pip-9.0.1: 
Aug 13 08:47:34       Successfully uninstalled pip-9.0.1 
Aug 13 08:47:35 Successfully installed pip-20.2.2 
Aug 13 08:47:35 + pip install -q --user -i https://test.pypi.org/simple/ ort-nightly==1.4.0.dev202007311 
Aug 13 08:47:35 ERROR: Could not find a version that satisfies the requirement ort-nightly==1.4.0.dev202007311 (from versions: 1.4.0.dev202007271) 
Aug 13 08:47:35 ERROR: No matching distribution found for ort-nightly==1.4.0.dev202007311 

See CircleCI build caffe2_onnx_ort2_py3_6_clang7_ubuntu16_04_test (3/3)

Step: "Test" (full log | diagnosis details | 🔁 rerun)

Aug 13 08:46:42 ERROR: No matching distribution found for ort-nightly==1.4.0.dev202007311
Aug 13 08:46:39 The directory '/var/lib/jenkins/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Aug 13 08:46:39 Collecting pip 
Aug 13 08:46:39   Downloading https://files.pythonhosted.org/packages/5a/4a/39400ff9b36e719bdf8f31c99fe1fa7842a42fa77432e584f707a5080063/pip-20.2.2-py2.py3-none-any.whl (1.5MB) 
Aug 13 08:46:40 Installing collected packages: pip 
Aug 13 08:46:40   Found existing installation: pip 9.0.1 
Aug 13 08:46:40     Uninstalling pip-9.0.1: 
Aug 13 08:46:40       Successfully uninstalled pip-9.0.1 
Aug 13 08:46:41 Successfully installed pip-20.2.2 
Aug 13 08:46:41 + pip install -q --user -i https://test.pypi.org/simple/ ort-nightly==1.4.0.dev202007311 
Aug 13 08:46:42 ERROR: Could not find a version that satisfies the requirement ort-nightly==1.4.0.dev202007311 (from versions: 1.4.0.dev202007271) 
Aug 13 08:46:42 ERROR: No matching distribution found for ort-nightly==1.4.0.dev202007311 

🚧 1 ongoing upstream failure:

These were probably caused by upstream breakages that are not fixed yet:


ci.pytorch.org: 1 failed


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 119 times.

taivu1998 pushed a commit that referenced this pull request Jul 27, 2020
ghstack-source-id: 8b71878
Pull Request resolved: #42133
taivu1998 pushed a commit that referenced this pull request Jul 28, 2020
ghstack-source-id: f6becbe
Pull Request resolved: #42133
taivu1998 pushed a commit that referenced this pull request Jul 28, 2020
ghstack-source-id: 746a334
Pull Request resolved: #42133
@taivu1998 taivu1998 requested a review from ZolotukhinM July 28, 2020 05:51
taivu1998 pushed a commit that referenced this pull request Jul 28, 2020
ghstack-source-id: 746a334
Pull Request resolved: #42133
@taivu1998 taivu1998 requested a review from iseeyuan July 28, 2020 20:06
module_names[module._ivalue()] = getSubModuleName(module, prefix);
for (NameModule s : module.named_children()) {
constructRelativeNamesForModules(s.value, prefix + "." + s.name);
std::string newPrefix = (!has_duplicated_function) ?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of calling has_duplicated_function, maybe we can say class_types_are_not_unique. Also put a comment suggesting why is this necessary? Give an example, like when doing traced module vs scripted module with two instances of same type what can happen, and what we are doing for that.

for (NameModule s : module.named_children()) {
constructRelativeNamesForModules(s.value, prefix + "." + s.name);
std::string newPrefix = (!has_duplicated_function) ?
module_names[module._ivalue()] + "." + s.name : module_names[module._ivalue()] + ".";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When has_duplicated_function=true, I suggest add something like .

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify your suggestion a bit? Also, since we decided not to save module info the two cases differently, I believe that we don't need to check for has_duplicated_function here. Is that correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify your suggestion a bit? Also, since we decided not to save module info the two cases differently, I believe that we don't need to check for has_duplicated_function here. Is that correct?

Are you talking about not checking has_duplicated_function for this PR or after the other PR

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When has_duplicated_function=true, I suggest add something like .

My first comment had trail off. I meant when has_duplicated_function=true, add "." or something like that.

Comment on lines 83 to 96
if (has_duplicated_function) {
SourceRange r = frame.second;
if (r.source()) {
if (auto orig = r.source()->findSourceRangeThatGenerated(r)) {
r = *orig;
}
}
if (auto file_line_col = r.file_line_col()) {
std::string filename;
size_t line, col;
std::tie(filename, line, col) = *file_line_col;
scopeString += "(" + filename + ":" + c10::to_string(line) + ":" + c10::to_string(col) + ")";
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear to me why we should do this? If we decide that this might help, then it is probably best to split it out into a helper function with comments and fn name that suggests what it will do.
But let's first clarify what does this do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was for adding source range info in the case of a scripted module, as @ZolotukhinM suggested before. But I think I'm gonna remove it now as we decided not to do things differently for the two types of modules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make it a separate function in that case, atleast, till we resolve it.


visitBlock(graph->block());
if (has_duplicated_function) {
std::cout << "WARNING: There are some duplicated module instances." << std::endl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not clear. Maybe say your module seems to have two instances of the same type. Current debugging does not support distinguishing the two instances of the same type yet. Thus debugging information maybe incomplete. Or something to the effect.

Copy link
Contributor Author

@taivu1998 taivu1998 Jul 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'll fix that. One small question: Since it's a warning, is it ok to directly print it directly to std::cout like this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. I missed this. I think there is something like TORCH_WARN or torch_debug soemthing. I will have to check.

taivu1998 pushed a commit that referenced this pull request Aug 12, 2020
ghstack-source-id: 306aa75
Pull Request resolved: #42133
Copy link
Contributor

@kimishpatel kimishpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really good Tai. Thanks for making this change.

@kimishpatel kimishpatel requested a review from iseeyuan August 12, 2020 16:04
py::arg("filename"),
py::arg("_extra_files") = ExtraFilesMap())
py::arg("_extra_files") = ExtraFilesMap(),
py::arg("_save_debug_info_in_bytecode") = false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this covered by tests from Python side? The tests could be added in test/mobile/test_lite_script_module.py.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added Python tests. Since we have no access to the internal C++ object, I basically check if the outputs still match when we enable debug info saving and if module info strings are contained in the debug info buffer. Let me know if that suffices.

@taivu1998 taivu1998 requested a review from kimishpatel August 12, 2020 22:28
taivu1998 pushed a commit that referenced this pull request Aug 13, 2020
ghstack-source-id: 94f20b7
Pull Request resolved: #42133
taivu1998 pushed a commit that referenced this pull request Aug 13, 2020
ghstack-source-id: aa1095f
Pull Request resolved: #42133
@facebook-github-bot
Copy link
Contributor

@taivu1998 merged this pull request in ccd9f32.

@facebook-github-bot facebook-github-bot deleted the gh/taivu1998/2/head branch August 17, 2020 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants