Skip to content

Port torch/csrc/jit/runtime/register_string_ops.cpp to new operator registration API #36925

@ezyang

Description

@ezyang

We have a new operator registration API introduced in #36258, and we need to port all use sites of the old registration API to use it.

Here is the general recipe for porting:

  1. We must add def()s of the operators to the centralized location. For aten:: namespace, this location is the TORCH_LIBRARY(aten, m) { block in aten/src/ATen/templates/TypeDefault.cpp. A def looks like:
m.def("aten::splitlines(str self, bool keepends=False) -> str[]");
  1. We must translate the registrations in register_string_ops.cpp to the new registration form (staying in this file). You do this by adding a new TORCH_LIBRARY_IMPL block as such:
TORCH_LIBRARY_IMPL(aten, CatchAll, m) {
  m.impl("splitlines", [](std::string string, bool keepends) {
    // previous implementation
  });
  // ... rest of the registrations ...
}

NB: This is the first time we're porting the JIT operators to the new API, so there may be unforeseen complications.

This task is reserved for bootcamp, please get in contact with me before starting work on it.

cc @suo

Metadata

Metadata

Assignees

Labels

oncall: jitAdd this issue/PR to JIT oncall triage queuetriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions