internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: apache/tvm

Issue:
Fix conv2d grad for strided cases under the new conv2d_transpose def
https://ci.tvm.ai/blue/organizations/jenkins/tvm/detail/PR-6173/3/pipeline




Discussion:
An additional note is that we should change the grad verification to use numerical grad checking instead of Pytorch
cc @jroesch @MarisaKirisame @junrushao1994 @antinucleon 
I bisected this by building with ci-gpu and running `tests/python/relay/test_op_grad_level2.py` 10 times, I believe the offending PR is #5758 
 @vinx13  it would be great if you can followup on this thread
In particular, it seems that we will need to fix the [conv2d grad](https://github.com/vinx13/tvm/blob/master/python/tvm/relay/op/_tensor_grad.py#L339) def under the new spec of conv2d_transpose introduced in #5758. Thanks @areusch for finding the offending PR
I will take a look
NOTE, the test is temporarily disabled in https://github.com/apache/incubator-tvm/pull/6183, we will update this issue again once @vinx13 fix the problem

Resolving patch:
diff --git a/python/tvm/topi/cuda/conv2d_transpose_nchw.py b/python/tvm/topi/cuda/conv2d_transpose_nchw.py
--- a/python/tvm/topi/cuda/conv2d_transpose_nchw.py
+++ b/python/tvm/topi/cuda/conv2d_transpose_nchw.py
@@ -65,13 +65,13 @@ def conv2d_transpose_nchw(cfg, data, kernel, stride, padding, out_dtype,
     out_width = (inp_width - 1) * stride_width + \
         kernel_width - pad_left - pad_right + outpad_width
     pad_left = kernel_width - 1 - pad_left
-    pad_right = kernel_width - 1 - pad_right
+    pad_right = kernel_width - 1 - pad_right + outpad_width
     dilated_width = stride_width * (inp_width - 1) + 1
 
     out_height = (inp_height - 1) * stride_height + \
         kernel_height - pad_top - pad_bottom + outpad_height
     pad_top = kernel_height - 1 - pad_top
-    pad_bottom = kernel_height - 1 - pad_bottom
+    pad_bottom = kernel_height - 1 - pad_bottom + outpad_height
     dilated_height = stride_height * (inp_height - 1) + 1
 
     # compute pad


Test patch:
diff --git a/tests/python/relay/test_op_grad_level2.py b/tests/python/relay/test_op_grad_level2.py
--- a/tests/python/relay/test_op_grad_level2.py
+++ b/tests/python/relay/test_op_grad_level2.py
@@ -151,8 +151,7 @@ def verify_conv2d_grad(dshape, wshape, strides, padding, dilation, groups=1, mod
 def test_conv2d_grad():
     verify_conv2d_grad((1, 4, 16, 16), (16, 4, 3, 3), [1, 1], [1, 1], [1, 1])
     verify_conv2d_grad((1, 4, 16, 16), (16, 4, 1, 1), [1, 1], [0, 0], [1, 1])
-    # TODO(@vinx13) recover the test after we fix the conv2d grad.
-    # verify_conv2d_grad((1, 4, 16, 16), (16, 4, 1, 1), [2, 2], [0, 0], [1, 1])
+    verify_conv2d_grad((1, 4, 16, 16), (16, 4, 1, 1), [2, 2], [0, 0], [1, 1])
     verify_conv2d_grad((1, 4, 16, 16), (16, 4, 3, 3), [1, 1], [1, 1], [1, 1], mode='first_order')
Repository: apache/tvm

Issue:
`import tvm` now requires pytest
With the merge of #6331, `import tvm` now requires pytest. I created this issue just to check whether this is something intentional or something that we want to fix.

The chain from `import tvm` to `import pytest` happens due to the `from .import testing` on `python/tvm/__init__.py`. There is nothing actually done with that import.

https://github.com/apache/incubator-tvm/blob/a4ebb16ed76bfea4ce4eed7be7ea73d4a01027e2/python/tvm/__init__.py#L53-L56

Within `python/tvm/testing.py` then there is the `import pytest`. I was thinking that we might want to remove these lines from `__init__.py`, so that we don't load `tvm.testing` and will only import it when required. I'm happy to submit a PR removing those lines, in case there is an understanding that it makes sense.

cc @tqchen 


Discussion:
I agree. thanks @leandron ! Please send a PR. cc @tkonolige 

Resolving patch:
diff --git a/python/tvm/__init__.py b/python/tvm/__init__.py
--- a/python/tvm/__init__.py
+++ b/python/tvm/__init__.py
@@ -51,9 +51,6 @@
 # tvm.te
 from . import te
 
-# tvm.testing
-from . import testing
-
 # tvm.driver
 from .driver import build, lower
 


Test patch:
Repository: apache/tvm

Issue:
[uTVM] Use an alternative CRC Library
The 3rdparty crc library introduced in https://github.com/apache/incubator-tvm/pull/6334 has a license problem.


We will need to replace it with a new impl or an alternative library



Discussion:
cc @areusch 

Resolving patch:
diff --git a/python/tvm/micro/build.py b/python/tvm/micro/build.py
--- a/python/tvm/micro/build.py
+++ b/python/tvm/micro/build.py
@@ -60,10 +60,7 @@ def path(self):
 
 
 RUNTIME_LIB_SRC_DIRS = [os.path.join(CRT_ROOT_DIR, n) for n in CRT_RUNTIME_LIB_NAMES] + [
-    os.path.join(
-        TVM_ROOT_DIR,
-        "3rdparty/mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_11/" "libraries/crc16",
-    )
+    os.path.join(TVM_ROOT_DIR, "3rdparty/libcrc/src")
 ]
 
 
@@ -76,8 +73,7 @@ def path(self):
     "include_dirs": [
         f"{TVM_ROOT_DIR}/include",
         f"{TVM_ROOT_DIR}/3rdparty/dlpack/include",
-        f"{TVM_ROOT_DIR}/3rdparty/mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/"
-        "TARGET_SDK_11/libraries/crc16/",
+        f"{TVM_ROOT_DIR}/3rdparty/libcrc/include",
         f"{TVM_ROOT_DIR}/3rdparty/dmlc-core/include",
         f"{CRT_ROOT_DIR}/include",
     ],


Test patch:
diff --git a/tests/crt/framing_test.cc b/tests/crt/framing_test.cc
--- a/tests/crt/framing_test.cc
+++ b/tests/crt/framing_test.cc
@@ -146,7 +146,7 @@ class UnframerTest : public ::testing::Test {
 
 TEST_F(UnframerTest, PacketTooLong) {
   const uint8_t escape[2] = {uint8_t(Escape::kEscapeStart), uint8_t(Escape::kPacketStart)};
-  uint16_t crc = crc16_compute(escape, sizeof(escape), nullptr);
+  uint16_t crc = tvm::runtime::micro_rpc::crc16_compute(escape, sizeof(escape), nullptr);
   size_t bytes_consumed;
   EXPECT_EQ(kTvmErrorNoError, unframer_.Write(escape, sizeof(escape), &bytes_consumed));
   EXPECT_EQ(sizeof(escape), bytes_consumed);
@@ -156,7 +156,7 @@ TEST_F(UnframerTest, PacketTooLong) {
   for (size_t i = 0; i < sizeof(packet_length); i++) {
     ASSERT_NE('\xff', packet_length_bytes[i]);
   }
-  crc = crc16_compute(packet_length_bytes, sizeof(packet_length), &crc);
+  crc = tvm::runtime::micro_rpc::crc16_compute(packet_length_bytes, sizeof(packet_length), &crc);
   EXPECT_EQ(kTvmErrorNoError,
             unframer_.Write(packet_length_bytes, sizeof(packet_length), &bytes_consumed));
   EXPECT_EQ(sizeof(packet_length), bytes_consumed);
@@ -168,7 +168,7 @@ TEST_F(UnframerTest, PacketTooLong) {
       long_payload[i] = 0;
     }
   }
-  crc = crc16_compute(long_payload, sizeof(long_payload), &crc);
+  crc = tvm::runtime::micro_rpc::crc16_compute(long_payload, sizeof(long_payload), &crc);
   EXPECT_EQ(kTvmErrorWriteStreamShortWrite,
             unframer_.Write(long_payload, sizeof(long_payload), &bytes_consumed));
   EXPECT_EQ(write_stream_.capacity(), bytes_consumed);
Repository: apache/tvm

Issue:
[TOPI] Typo in operator key
https://github.com/apache/incubator-tvm/blob/bdfefbb03f5aab96ee677ee28a166dd6ab5dbf3f/python/tvm/topi/bifrost/dense.py#L26

"biforst" should be "bifrost". This bug makes the op totally unavailable in Relay.

I can fix this bug if expected, but I don't know how to add a proper test.


Discussion:
cc @mbaret @icemelon9 

I think we I have test in test_topi: https://github.com/apache/incubator-tvm/blob/master/tests/python/topi/python/test_topi_dense.py#L40, but the target is probably not enabled in the CI
Ah yes... It's very difficult to keep these maintained due to the lack of a Mali GPU in CI. I don't have immediate access to one either but that change looks obviously correct to me.
Thanks @roastduck please send a PR

Resolving patch:
diff --git a/python/tvm/topi/bifrost/dense.py b/python/tvm/topi/bifrost/dense.py
--- a/python/tvm/topi/bifrost/dense.py
+++ b/python/tvm/topi/bifrost/dense.py
@@ -23,7 +23,7 @@
 from ..util import traverse_inline
 
 
-@autotvm.register_topi_compute("dense.biforst")
+@autotvm.register_topi_compute("dense.bifrost")
 def dense(_, data, weight, bias=None, out_dtype=None):
     """Dense operator on Biforst"""
     return nn.dense(data, weight, bias, out_dtype)


Test patch:
Repository: apache/tvm

Issue:
Do not show meta data when printing TIR
Recently I found TVM will print meta when I do 
```python
print(tvm.lower(s, [A, B, C], simple_mode=True))
```

Here is an example output in the tutorial website (https://tvm.apache.org/docs/tutorials/language/schedule_primitives.html)
```
#[version = "0.0.5"]
primfn(A_1: handle, B_1: handle, C_1: handle) -> ()
  attr = {"global_symbol": "main", "tir.noalias": True}
  buffers = {C: Buffer(C_2: Pointer(float32), float32, [m: int32, n: int32], [stride: int32, stride_1: int32], type="auto"),
             B: Buffer(B_2: Pointer(float32), float32, [m, n], [stride_2: int32, stride_3: int32], type="auto"),
             A: Buffer(A_2: Pointer(float32), float32, [m, n], [stride_4: int32, stride_5: int32], type="auto")}
  buffer_map = {A_1: A, B_1: B, C_1: C} {
  for (i: int32, 0, m) {
    for (j: int32, 0, n) {
      C_2[((i*stride) + (j*stride_1))] = ((float32*)A_2[((i*stride_4) + (j*stride_5))]*(float32*)B_2[((i*stride_2) + (j*stride_3))])
    }
  }
}

#[metadata]
{
  "root": 1,
  "nodes": [
    {
      "type_key": ""
    },
    {
      "type_key": "Map",
      "keys": [
        "IntImm"
      ],
      "data": [2]
    },
    {
      "type_key": "Array",
      "data": [3]
    },
    {
      "type_key": "IntImm",
      "attrs": {
        "dtype": "bool",
        "value": "1"
      }
    }
  ],
  "b64ndarrays": [],
  "attrs": {"tvm_version": "0.8.dev0"}
}
```

I found this very annoying.  Why do we print it? Can we disable it for this use case by default?
cc @tqchen @spectrometerHBH @jroesch @junrushao1994 


Discussion:
You may slightly these lines: https://github.com/apache/incubator-tvm/blob/main/python/tvm/ir/module.py#L253-L258, adding `show_meta_data=False` to `self.astext`
@jroesch shall we turn off the `show_meta_data` in `IRModule.__str__` and `IRModule.__repr__`? If so, @merrymercy would you mind send a PR?
I agree that for repr and str we should turn off the meta data since they are not strictly required

Resolving patch:
diff --git a/python/tvm/ir/module.py b/python/tvm/ir/module.py
--- a/python/tvm/ir/module.py
+++ b/python/tvm/ir/module.py
@@ -251,8 +251,7 @@ def import_from_std(self, file_to_import):
         return tvm.relay.transform.InferType()(self)
 
     def __str__(self):
-        # TODO(jroesch): why does this hang sometimes?
-        return self.astext()
+        return _ffi_api.PrettyPrint(self)
 
     def __repr__(self):
         return self.astext()


Test patch:
Repository: apache/tvm

Issue:
uTVM fails to build runtime for Arm Target
given:

TARGET = tvm.target.target.micro("stm32f746xx")

with tvm.transform.PassContext(
    opt_level=3, config={"tir.disable_vectorize": True}, disabled_pass=["FuseOps"]
):
    graph, c_mod, c_params = relay.build(mod, target=TARGET, params=params)

workspace = tvm.micro.Workspace()

compiler = tvm.micro.DefaultCompiler(target=TARGET)
opts = tvm.micro.default_options(os.path.join(tvm.micro.CRT_ROOT_DIR, "stm32f746xx"))

micro_binary = tvm.micro.build_static_runtime(
    workspace,
    compiler,
    c_mod,
    lib_opts=opts["bin_opts"],
    bin_opts=opts["bin_opts"],
)

Creating the runtime will fail with 

arm-none-eabi-g++: error: missing argument to '-march='

It's not exactly surprising since  
RuntimeError: error while running command "arm-none-eabi-g++ -g -march=cortex-m7 -std=c++11 -Wall -Werror -I /home/tgall/tvm/tvm/include -I /home/tgall/tvm/tvm/3rdparty/dlpack/include -I /home/tgall/tvm/tvm/3rdparty/libcrc/include -I /home/tgall/tvm/tvm/3rdparty/dmlc-core/include -I /home/tgall/tvm/tvm/src/runtime/crt/include -I /home/tgall/tvm/tvm/src/runtime/crt/stm32f746xx -c -o /tmp/tmpv6j60fia/build/utvm_rpc_server/rpc_server.o /home/tgall/tvm/tvm/src/runtime/crt/utvm_rpc_server/rpc_server.cc":
arm-none-eabi-g++: error: unrecognized -march target: cortex-m7

So what is the fix?  

cortex-m7 is an -mcpu setting.

Instead 
-march=armv7-m when targeting and m3
-march=armv7e-m when targeting an m4, m7 (like the discovery)   
-march=armv8-m when targeting an m33

Patch incoming. 

@areusch 


Discussion:

Resolving patch:
diff --git a/python/tvm/micro/compiler.py b/python/tvm/micro/compiler.py
--- a/python/tvm/micro/compiler.py
+++ b/python/tvm/micro/compiler.py
@@ -139,9 +139,11 @@ def _defaults_from_target(self, target):
         opts = []
         # TODO use march for arm(https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html)?
         if target.attrs.get("mcpu"):
-            opts.append(f'-march={target.attrs["mcpu"]}')
+            opts.append(f'-mcpu={target.attrs["mcpu"]}')
         if target.attrs.get("mfpu"):
             opts.append(f'-mfpu={target.attrs["mfpu"]}')
+        if target.attrs.get("march"):
+            opts.append(f'-march={target.attrs["march"]}')
 
         return opts
 
diff --git a/python/tvm/target/target.py b/python/tvm/target/target.py
--- a/python/tvm/target/target.py
+++ b/python/tvm/target/target.py
@@ -233,7 +233,7 @@ def micro(model="unknown", options=None):
     """
     trans_table = {
         "host": ["-mcpu=native"],
-        "stm32f746xx": ["-mcpu=cortex-m7"],
+        "stm32f746xx": ["-mcpu=cortex-m7", "-march=armv7e-m"],
     }
     opts = _merge_opts(
         trans_table[model] + ["-runtime=c", "--system-lib", f"-model={model}"], options


Test patch:
Repository: apache/tvm

Issue:
[Frontend][Relay] YOLO module is unparsable
The module generated from the code in this tutorial: https://tvm.apache.org/docs/tutorials/frontend/from_darknet.html
causes the following error when parsed by:

```
import tvm
tvm.parser.parse(mod.astext())
```

error: expected a local variable found `.`, which is caused by formals (i.e %LAYERTYPE.CONVOLUTIONAL0_weight: Tensor[(32, 3, 3, 3), float32]) which the '.' character, which is unrecognized by the parser.

@jroesch recommended two options:
1. modify importer to replace invalid characters
2. modify parser to handle the '.' character


Discussion:

Resolving patch:
diff --git a/python/tvm/relay/frontend/darknet.py b/python/tvm/relay/frontend/darknet.py
--- a/python/tvm/relay/frontend/darknet.py
+++ b/python/tvm/relay/frontend/darknet.py
@@ -40,7 +40,7 @@ def _darknet_not_support(attr, op="relay"):
 
 def _get_params_prefix(opname, layer_num):
     """Makes the params prefix name from opname and layer number."""
-    return str(opname) + str(layer_num)
+    return str(opname).replace(".", "_") + str(layer_num)
 
 
 def _get_params_name(prefix, item):


Test patch:
diff --git a/tests/python/frontend/darknet/test_forward.py b/tests/python/frontend/darknet/test_forward.py
--- a/tests/python/frontend/darknet/test_forward.py
+++ b/tests/python/frontend/darknet/test_forward.py
@@ -45,6 +45,17 @@
 )
 
 
+def astext(program, unify_free_vars=False):
+    """check that program is parsable in text format"""
+    text = program.astext()
+    if isinstance(program, relay.Expr):
+        roundtrip_program = tvm.parser.parse_expr(text)
+    else:
+        roundtrip_program = tvm.parser.fromtext(text)
+
+    tvm.ir.assert_structural_equal(roundtrip_program, program, map_free_vars=True)
+
+
 def _read_memory_buffer(shape, data, dtype="float32"):
     length = 1
     for x in shape:
@@ -59,6 +70,10 @@ def _get_tvm_output(net, data, build_dtype="float32", states=None):
     """Compute TVM output"""
     dtype = "float32"
     mod, params = relay.frontend.from_darknet(net, data.shape, dtype)
+    # verify that from_darknet creates a valid, parsable relay program
+    mod = relay.transform.InferType()(mod)
+    astext(mod)
+
     target = "llvm"
     shape_dict = {"data": data.shape}
     lib = relay.build(mod, target, params=params)
diff --git a/tests/python/relay/test_ir_text_printer.py b/tests/python/relay/test_ir_text_printer.py
--- a/tests/python/relay/test_ir_text_printer.py
+++ b/tests/python/relay/test_ir_text_printer.py
@@ -21,6 +21,7 @@
 import numpy as np
 from tvm.relay import Expr
 from tvm.relay.analysis import free_vars
+import pytest
 
 DEBUG_PRINT = False
 
@@ -269,6 +270,4 @@ def test_span():
 
 
 if __name__ == "__main__":
-    import sys
-
-    pytext.argv(sys.argv)
+    pytest.main([__file__])
Repository: apache/tvm

Issue:
[Frontend][PyTorch] NotImplementedError: The following operators are not implemented: ['aten::is_floating_point', 'aten::true_divide']
I'm using file /python/tvm/relay/frontend/pytorch.py to convert pytorch model, but raise error like this:
![image](https://user-images.githubusercontent.com/68592047/89726825-a1348000-da51-11ea-8368-124062d4aa52.png)

pytorch == 1.6.0 and tvm is latest



Discussion:
@masahi 
It seems that true_divide is supported as of #6472, but `is_floating_point` is definitely missing. I'm currently looking at adding support for `is_floating_point`, and I hope to have something before the week is done.

Resolving patch:
diff --git a/python/tvm/relay/frontend/pytorch.py b/python/tvm/relay/frontend/pytorch.py
--- a/python/tvm/relay/frontend/pytorch.py
+++ b/python/tvm/relay/frontend/pytorch.py
@@ -2059,9 +2059,21 @@ def scatter_add(self, inputs, input_types):
         src = inputs[3]
         return _op.scatter_add(data, index, src, axis=axis)
 
+    def is_floating_point(self, inputs, input_types):
+        assert len(inputs) == 1
+
+        if isinstance(inputs[0], _expr.Expr):
+            input_type = self.infer_type(inputs[0]).dtype
+        else:
+            input_type = input_types[0]
+
+        is_float = input_type in ["float32", "float64", "float16"]
+        return _expr.const(is_float)
+
     # Operator mappings
     def create_convert_map(self):
         self.convert_map = {
+            "aten::is_floating_point": self.is_floating_point,
             "aten::pixel_shuffle": self.pixel_shuffle,
             "aten::device": self.none,
             "prim::device": self.none,
@@ -2077,6 +2089,7 @@ def create_convert_map(self):
             "aten::div": self.make_elemwise("divide"),
             "aten::div_": self.make_elemwise("divide"),
             "aten::floor_divide": self.make_elemwise("floor_divide"),
+            "aten::floor_divide_": self.make_elemwise("floor_divide"),
             "aten::true_divide": self.make_elemwise("divide"),
             "aten::addcdiv": self.addcdiv,
             "aten::addcmul": self.addcmul,


Test patch:
Repository: apache/tvm

Issue:
[BUG] tvmc runner: print_top sorts output causing sorted output to be stored.
The options print_top and outputs are currently incompatible, get_top_results should work on a copy of outputs.
Otherwise sorted outputs are stored in .npz

https://github.com/apache/tvm/blob/8524b28078928caf5c8ca82442ad0eab81dce838/python/tvm/driver/tvmc/runner.py#L127


Discussion:
Thanks for pointing out. Would you send a PR to fix it?
Also cc @leandron 

Resolving patch:
diff --git a/python/tvm/driver/tvmc/runner.py b/python/tvm/driver/tvmc/runner.py
--- a/python/tvm/driver/tvmc/runner.py
+++ b/python/tvm/driver/tvmc/runner.py
@@ -427,7 +427,7 @@ def get_top_results(outputs, max_results):
         The first row is the indices and the second is the values.
 
     """
-    output = outputs["output_0"]
+    output = np.copy(outputs["output_0"])
     sorted_labels = output.argsort()[0][-max_results:][::-1]
     output.sort()
     sorted_values = output[0][-max_results:][::-1]


Test patch:
Repository: apache/tvm

Issue:
Fix a word typo and add spaces.
Thanks for contributing to TVM!   Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from [Reviewers](https://github.com/apache/incubator-tvm/blob/master/CONTRIBUTORS.md#reviewers) by @ them in the pull request thread.

Please help to review. Thank you so much! :)
@tqchen 


Discussion:

Resolving patch:
diff --git a/apps/microtvm/zephyr/template_project/microtvm_api_server.py b/apps/microtvm/zephyr/template_project/microtvm_api_server.py
--- a/apps/microtvm/zephyr/template_project/microtvm_api_server.py
+++ b/apps/microtvm/zephyr/template_project/microtvm_api_server.py
@@ -678,9 +678,9 @@ def write(self, data, timeout_sec):
                 escape_pos.append(i)
             to_write.append(b)
 
-        num_written = server.write_with_timeout(self.write_fd, to_write, timeout_sec)
-        num_written -= sum(1 if x < num_written else 0 for x in escape_pos)
-        return num_written
+        while to_write:
+            num_written = server.write_with_timeout(self.write_fd, to_write, timeout_sec)
+            to_write = to_write[num_written:]
 
     def _qemu_check_stdout(self):
         for line in self.proc.stdout:


Test patch:
Repository: apache/tvm

Issue:
[Bug] RPC Server Can't Serve Through Proxy Because of Missing Command Line Option
Now we have RPC server, proxy, and tracker, so if the host machine can't access the RPC server directly, then we can put RPC proxy between host machine and RPC server like "Host --> RPC Proxy --> RPC Server", we can do it from Python API, but we can't do it through command line. Because "tvm.exec.rpc_server" haven't exposed the parameter "is_proxy" of class "tvm.rpc.server.Server" through command line option.

### Expected behavior

Can register the RPC server to RPC proxy from command line like something below.
```shell
python -m tvm.exec.rpc_server --host 0.0.0.0 --port 9090 --through-proxy
```

### Actual behavior

Currently haven't any command line option to set the parameter "is_proxy".

### Environment

No

### Steps to reproduce

Any


Discussion:

Resolving patch:
diff --git a/python/tvm/exec/rpc_server.py b/python/tvm/exec/rpc_server.py
--- a/python/tvm/exec/rpc_server.py
+++ b/python/tvm/exec/rpc_server.py
@@ -42,6 +42,7 @@ def main(args):
         args.host,
         args.port,
         args.port_end,
+        is_proxy=args.through_proxy,
         key=args.key,
         tracker_addr=tracker_addr,
         load_library=args.load_library,
@@ -58,6 +59,15 @@ def main(args):
         "--host", type=str, default="0.0.0.0", help="The host IP address the tracker binds to"
     )
     parser.add_argument("--port", type=int, default=9090, help="The port of the RPC")
+    parser.add_argument(
+        "--through-proxy",
+        dest="through_proxy",
+        action="store_true",
+        help=(
+            "Whether this server provide service through a proxy. If this is true, the host and"
+            "port actually is the address of the proxy."
+        ),
+    )
     parser.add_argument("--port-end", type=int, default=9199, help="The end search port of the RPC")
     parser.add_argument(
         "--tracker",


Test patch: