Skip to content

Conversation

@jamesr66a
Copy link
Collaborator

@jamesr66a jamesr66a commented Jun 25, 2019

Stack from ghstack:

Differential Revision: D15981426

James Reed added 2 commits June 24, 2019 19:03
[JIT] Serialization methods for SourceRange and Source

gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
[JIT] Serialization methods for SourceRange and Source

gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
Copy link
Contributor

@zdevito zdevito left a comment

Choose a reason for hiding this comment

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

The methods need to be put into a separate compilation unit to avoid bloating the dependency tree for source_range objects, which are widely used.

[JIT] Serialization methods for SourceRange and Source

gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
@jamesr66a jamesr66a requested a review from zdevito June 26, 2019 17:16
c10::IValue serialize(const SourceRange& sr) {
std::vector<c10::IValue> elements = {
serialize_source(sr.source()), (int64_t)sr.start(), (int64_t)sr.end()};
return c10::ivalue::Tuple::create(elements);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: move

}
std::vector<c10::IValue> elements{
s->text(), s->filename(), (int64_t)s->starting_line_no()};
auto serialized = c10::ivalue::Tuple::create(elements);
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: move

James Reed added 3 commits June 27, 2019 21:27
[JIT] Serialization methods for SourceRange and Source

gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
[JIT] Serialization methods for SourceRange and Source

gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
[JIT] Serialization methods for SourceRange and Source

gh-metadata: pytorch pytorch 22178 gh/jamesr66a/7/head
@zou3519 zou3519 deleted the gh/jamesr66a/7/head branch July 2, 2019 04:17
@facebook-github-bot
Copy link
Contributor

@jamesr66a merged this pull request in e05942c.

xzhu1900 pushed a commit to xzhu1900/pytorch that referenced this pull request Jul 5, 2019
Summary:
Pull Request resolved: pytorch#22178
ghimport-source-id: 85ca4d4

Test Plan: Imported from OSS

Differential Revision: D15981426

Pulled By: jamesr66a

fbshipit-source-id: f81f5ee3b66fc4a0d4a708b8109712b5df9f241a
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