Skip to content

Conversation

jamesr66a
Copy link
Collaborator

@jamesr66a jamesr66a commented Mar 2, 2020

Stack from ghstack:

Differential Revision: D20229166

@jamesr66a jamesr66a requested a review from apaszke as a code owner March 2, 2020 23:00
jamesr66a pushed a commit that referenced this pull request Mar 2, 2020
@dr-ci
Copy link

dr-ci bot commented Mar 2, 2020

💊 CircleCI build failures summary and remediations

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


Commit 0ca0eec was recently pushed. Waiting for builds...


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.

This comment has been revised 40 times.

}

void run(Stack& stack) override {
auto handle = c10::Dispatcher::singleton().findSchemaOrThrow(
Copy link
Contributor

Choose a reason for hiding this comment

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

BuiltinOp should just store its Schema, and std::function<void(Stack&)> directly. It does not have to participate in dispatch (and in fact will mostly only incur overhead because of it).

Copy link
Collaborator

Choose a reason for hiding this comment

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

@zdevito - hm, are you sure about that? I'd at least want to have it go through dispatcher to get profiling working. TorchBind ops can be potentially big so it's good to capture them through the same profiling infra. Alternatively - we can just slap the same RecordFunction here too

Also I'm pretty sure someone will want tracing to work too (though it's debatable)

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 2, 2020
@jamesr66a jamesr66a requested a review from zdevito March 3, 2020 17:54
@jamesr66a jamesr66a requested review from dzhulgakov and suo March 3, 2020 23:11
classTypePtr->addAttribute("capsule", at::CapsuleType::get());

c10::getCustomClassTypeMap().insert(
{typeid(c10::intrusive_ptr<CurClass>).name(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

do you need demangle here and everywhere? Also - do we need to rely on RTTI for it? you could also use c10::get_fully_qualified_type_name (not sure where exactly we use these names). Or we never use those names other than for accounting? (in which case maybe we should just use typeid directly)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I already asked this in another PR: why do we need demangling? We're simply looking for an exact match. In fact, if demangling is a lossy process, wouldn't that create bugs?

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.

This looks like it is going to work. Thanks for all the revisions. I just have some minor things to resolve inline.

bool AllowDeprecatedTypes,
size_t... ivalue_arg_indices>
typename c10::guts::infer_function_traits_t<Functor>::return_type
call_torchbind_method_from_stack(
Copy link
Contributor

Choose a reason for hiding this comment

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

This appears to be unused?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's used in BoxedProxy below

cu_ = std::move(cu);
type_ = type;
TORCH_INTERNAL_ASSERT(type_);
if (type_->cast<ClassType>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

We can possiblly keep this assert if the class table no longer holds StrongTypePtr objects

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ivalue::object::create requires a StrongTypePtr for instantiation of any object, and if it's a custom class that's going to be nullptr, so I don't think we can remove this

@jamesr66a jamesr66a requested a review from zdevito March 6, 2020 21:56
frames.back().pc = af.pc + 1;
enterFrame(code, stack.size() - inst.N);
af = ActiveFrame(frames.back());
if (!function->isGraphFunction()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: maybe have runFunction be a function, since this if-statement occurs twice.

@facebook-github-bot
Copy link
Contributor

@jamesr66a merged this pull request in 45a504d.

@facebook-github-bot facebook-github-bot deleted the gh/jamesr66a/203/head branch March 11, 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.

5 participants