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

Issue:
[Bug][microTVM] dense_dsp ARM schedule is not picked up in autotuning
When we run auto tune function for a model with dense layers, like anomaly detection, we don't see dense_dsp in the extracted tasks.
This was originally reported by @guberti 

cc @alanmacd @gromero


Discussion:

Resolving patch:
diff --git a/python/tvm/relay/op/strategy/arm_cpu.py b/python/tvm/relay/op/strategy/arm_cpu.py
--- a/python/tvm/relay/op/strategy/arm_cpu.py
+++ b/python/tvm/relay/op/strategy/arm_cpu.py
@@ -474,11 +474,13 @@ def schedule_dense_arm_cpu(attrs, inputs, out_type, target):
     """dense arm cpu strategy"""
     strategy = _op.OpStrategy()
     isa = arm_isa.IsaAnalyzer(target)
-    if isa.has_dsp_support:
+    data, _ = inputs
+
+    if isa.has_dsp_support and data.dtype in ["int8", "int16"]:
         strategy.add_implementation(
-            wrap_compute_dense(topi.nn.dense),
+            wrap_compute_dense(topi.arm_cpu.dense_dsp),
             wrap_topi_schedule(topi.arm_cpu.schedule_dense_dsp),
-            name="dense_dsp",
+            name="dense_dsp.arm_cpu",
         )
     else:
         logger.warning("dense is not optimized for arm cpu.")
@@ -511,7 +513,7 @@ def conv1d_strategy_arm_cpu(attrs, inputs, out_type, target):
             strategy.add_implementation(
                 wrap_compute_conv1d(topi.arm_cpu.conv1d_nwc_dsp),
                 wrap_topi_schedule(topi.arm_cpu.schedule_conv1d_nwc_dsp),
-                name="conv1d_dsp",
+                name="conv1d_dsp.arm_cpu",
             )
         else:
             raise RuntimeError(
diff --git a/python/tvm/topi/arm_cpu/dense.py b/python/tvm/topi/arm_cpu/dense.py
--- a/python/tvm/topi/arm_cpu/dense.py
+++ b/python/tvm/topi/arm_cpu/dense.py
@@ -17,9 +17,19 @@
 # pylint: disable=invalid-name, unused-variable, no-else-return, unused-argument, import-outside-toplevel
 """Dense schedule for ARM CPU"""
 
+from tvm import autotvm
+from tvm.topi.nn import dense
+
 from .mprofile.dsp.dense import dense_dsp_schedule
 
 
-def schedule_dense_dsp(outs):
+@autotvm.register_topi_compute("dense_dsp.arm_cpu")
+def dense_dsp(cfg, data, weight, bias, out_dtype):
+    """Compute conv2d_nhwc with v7e-m DSP instructions."""
+    return dense(data, weight, bias=bias, out_dtype=out_dtype)
+
+
+@autotvm.register_topi_schedule("dense_dsp.arm_cpu")
+def schedule_dense_dsp(cfg, outs):
     """Create schedule for dense_dsp"""
     return dense_dsp_schedule(outs)


Test patch:
Repository: apache/tvm

Issue:
[Bug] deprecation warning when using tvmc compile with BYOC targets
See https://discuss.tvm.apache.org/t/how-to-get-rid-of-deprecated-target-warning-for-marvell-hybrid-target/13497.

```
$python3 -m pdb  -m tvm.driver.tvmc compile --target="mrvl, llvm" --output=b11_mlf.tar  cnn_b11.0_model.onnx

UserWarning: target_host parameter is going to be deprecated. Please pass in tvm.target.Target(target, host=target_host) instead.
  "target_host parameter is going to be deprecated. "
```

The warning should not be printed.


Discussion:

Resolving patch:
diff --git a/python/tvm/driver/build_module.py b/python/tvm/driver/build_module.py
--- a/python/tvm/driver/build_module.py
+++ b/python/tvm/driver/build_module.py
@@ -258,8 +258,6 @@ def build(
             raise ValueError("inputs must be Schedule, IRModule," "or dict of str to IRModule.")
         annotated_mods[tar] = mod.with_attr("runtime", runtime)
 
-    annotated_mods, target_host = Target.canon_target_map_and_host(annotated_mods, target_host)
-
     # TODO(mbs): Both CompilationConfig and TIRToRuntime implement the same host target
     #  defaulting logic, but there's currently no way to get back the decided host.
     if target_host is not None:
@@ -267,6 +265,8 @@ def build(
             "target_host parameter is going to be deprecated. "
             "Please pass in tvm.target.Target(target, host=target_host) instead."
         )
+
+    annotated_mods, target_host = Target.canon_target_map_and_host(annotated_mods, target_host)
     if not target_host:
         for tar, mod in annotated_mods.items():
             device_type = ndarray.device(tar.kind.name, 0).device_type


Test patch:
Repository: apache/tvm

Issue:
[Bug][ci] Deploy docs is busted
See for example https://ci.tlcpack.ai/blue/organizations/jenkins/tvm/detail/main/4756/pipeline

```
Traceback (most recent call last):
  File "./ci/scripts/jenkins/s3.py", line 134, in <module>
    chmod(files)
  File "./ci/scripts/jenkins/s3.py", line 70, in chmod
    SH.run(f"chmod +x {' '.join(to_chmod)}")
  File "/tmp/jenkins-ba6c252c/workspace/exec_0/tvm/deploy-docs/ci/scripts/jenkins/cmd_utils.py", line 78, in run
    return subprocess.run(cmd, **defaults)
  File "/usr/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 7] Argument list too long: '/bin/sh'
```

cc @Mousius @driazati @gigiblender


Discussion:

Resolving patch:
diff --git a/ci/scripts/jenkins/s3.py b/ci/scripts/jenkins/s3.py
--- a/ci/scripts/jenkins/s3.py
+++ b/ci/scripts/jenkins/s3.py
@@ -129,7 +129,12 @@ def s3(source: str, destination: str, recursive: bool) -> List[str]:
 
     for item in items:
         if action == Action.DOWNLOAD:
-            stdout = s3(source=s3_path, destination=item, recursive=True)
+            source = s3_path
+            recursive = True
+            if item != ".":
+                source = s3_path + "/" + item
+                recursive = False
+            stdout = s3(source=source, destination=item, recursive=recursive)
             files = parse_output_files(stdout)
             chmod(files)
             for file in files:


Test patch:
Repository: apache/tvm

Issue:
[Bug] Possible error in strided_slice_checker
Hello, I'm trying to use TensorRT for tuning my model. For that matter, I use partition_for_tensorrt before building the model. However, this function fails when processing strided_slice ops. This might be related to strided_slice ops, where fewer axes than tensor dimensions are sliced, e.g., `%435 = strided_slice(%376, begin=[0i64], end=[1i64], strides=[1i64], axes=[0i64])` with input tensors of 4 dims. I suspect that these ops will fail since the for loop https://github.com/apache/tvm/blob/7e3dc45fed385e12f8cfd9c9284b5551ada82f95/python/tvm/relay/op/contrib/tensorrt.py#L712-L713 iterates over the number of input dimensions while the strided_slice op does not necessarily cover all dimensions, e.g., in the above call only the 0th axis.


### Expected behavior

I expected the partition_for_tensorrt function to return without error.

### Actual behavior

IndexError in strided_slice_checker: https://github.com/apache/tvm/blob/7e3dc45fed385e12f8cfd9c9284b5551ada82f95/python/tvm/relay/op/contrib/tensorrt.py#L713, error thrown at: https://github.com/apache/tvm/blob/7e3dc45fed385e12f8cfd9c9284b5551ada82f95/python/tvm/runtime/container.py#L57

### Environment

OS: Ubuntu 20.04, Kernel 5.15
TVM: built from master branch, commit 0e046daf9e51724b3910aa7ba199069b09e2707e

### Triage

* needs-triage
* byoc:ethosu



Discussion:
You're right, the `axes` argument in `strided_slices` was added later. So when the TRT backend was developed, it was assumed that the size of begin / end is always equal to the rank of the input.

Can you send a PR to fix this?

Resolving patch:
diff --git a/python/tvm/relay/op/contrib/tensorrt.py b/python/tvm/relay/op/contrib/tensorrt.py
--- a/python/tvm/relay/op/contrib/tensorrt.py
+++ b/python/tvm/relay/op/contrib/tensorrt.py
@@ -709,7 +709,8 @@ def strided_slice_checker(
     if any([x is not None and x <= 0 for x in attrs.strides]):
         logger.info(f"{op_name}: stride must be positive")
         return False
-    for i in range(0, len(args[0].checked_type.shape)):
+    length: int = len(attrs.axes) if attrs.axes is not None else len(args[0].checked_type.shape)
+    for i in range(0, length):
         begin = int(attrs.begin[i])
         if attrs.slice_mode == "end":
             end = (


Test patch:
Repository: apache/tvm

Issue:
[Docs] `v0.11.dev0` still appears in the docs
I've noticed that we still have `v0.11.dev0` being shown in the documentation page at https://tvm.apache.org/docs/.

@areusch @driazati do you know how to make that to be updated to `v0.12.dev0`, which would be where we are now?



Discussion:
It looks like https://tvm.apache.org/docs/contribute/release_process.html#update-tvm-version-on-main still needs to happen (i'm seeing some `v0.11.0`s around e.g. in `conda/recipe/meta.yaml`)

Resolving patch:
diff --git a/python/tvm/_ffi/libinfo.py b/python/tvm/_ffi/libinfo.py
--- a/python/tvm/_ffi/libinfo.py
+++ b/python/tvm/_ffi/libinfo.py
@@ -222,4 +222,4 @@ def find_include_path(name=None, search_path=None, optional=False):
 # We use the version of the incoming release for code
 # that is under development.
 # The following line is set by tvm/python/update_version.py
-__version__ = "0.11.dev0"
+__version__ = "0.12.dev0"
diff --git a/version.py b/version.py
--- a/version.py
+++ b/version.py
@@ -44,7 +44,7 @@
 # Two tag formats are supported:
 # - vMAJ.MIN.PATCH (e.g. v0.8.0) or
 # - vMAJ.MIN.devN (e.g. v0.8.dev0)
-__version__ = "0.11.dev0"
+__version__ = "0.12.dev0"
 
 # ---------------------------------------------------
 


Test patch:
Repository: django/channels

Issue:
redis:// URL host & port configuration
A `redis://` URL is a great shorthand for redis hostname & port settings, and it can easily be stored in an environment variable. It's very handy for Docker/Dokku deployments and is used in other Django + redis libraries ([Celery](http://docs.celeryproject.org/en/latest/getting-started/brokers/redis.html#broker-redis), [django-redis](https://github.com/niwinz/django-redis))

Rather than:

```
...
        "HOSTS": [("redis-channel-1", 6379), ("redis-channel-2", 6379)],
...
```

It would look like this:

```
...
        "HOSTS": ["redis://redis-channel-1:6379/0", "redis://redis-channel-2:6379/0"],
...
```



Discussion:
Yes, this might be a good idea. I was trying to standardise the format of HOSTS across other potential backends, but there aren't any others with host support yet.

Might just be worth having both supported, they're easy to distinguish programmatically.

Choice is always good! The current (host, port) tuple is sensible. The `redis://` support would be nice, though, especially in deployment scenarios that provide a `redis://` URL (like [dokku-redis](https://github.com/dokku/dokku-redis)).

I think it's at least important to be able to add the database number for the redis server, since people might host more then one django app on the same server.

Did antirez back down on his plan to drop the database numbers?

database numbers are only deprecated for redis-cluster. Alternatively some kind of namespacing the keys would be possible ?

There's already a "PREFIX" setting that can be configured for the backend, it's just not documented yet.


Resolving patch:
diff --git a/channels/backends/redis_py.py b/channels/backends/redis_py.py
--- a/channels/backends/redis_py.py
+++ b/channels/backends/redis_py.py
@@ -22,10 +22,12 @@ def __init__(self, routing, expiry=60, hosts=None, prefix="django-channels:"):
         # Make sure they provided some hosts, or provide a default
         if not hosts:
             hosts = [("localhost", 6379)]
-        for host, port in hosts:
-            assert isinstance(host, six.string_types)
-            assert int(port)
-        self.hosts = hosts
+        self.hosts = []
+        for entry in hosts:
+            if isinstance(entry, six.string_types):
+                self.hosts.append(entry)
+            else:
+                self.hosts.append("redis://%s:%d/0" % (entry[0],entry[1]))
         self.prefix = prefix
         # Precalculate some values for ring selection
         self.ring_size = len(self.hosts)
@@ -57,8 +59,7 @@ def connection(self, index):
         # Catch bad indexes
         if not (0 <= index < self.ring_size):
             raise ValueError("There are only %s hosts - you asked for %s!" % (self.ring_size, index))
-        host, port = self.hosts[index]
-        return redis.Redis(host=host, port=port)
+        return redis.Redis.from_url(self.hosts[index])
 
     def send(self, channel, message):
         # if channel is no str (=> bytes) convert it


Test patch:
Repository: django/channels

Issue:
InMemoryChannelLayer: unused variable local_poll_interval
https://github.com/django/channels/blob/5feecdb6a0df720651851f377aee3587d07eceef/channels/layers.py#L199


Discussion:

Resolving patch:
diff --git a/channels/layers.py b/channels/layers.py
--- a/channels/layers.py
+++ b/channels/layers.py
@@ -196,8 +196,6 @@ class InMemoryChannelLayer(BaseChannelLayer):
     In-memory channel layer implementation
     """
 
-    local_poll_interval = 0.01
-
     def __init__(
         self,
         expiry=60,


Test patch:
Repository: django/channels

Issue:
Version 3.0
TODOs: 

- [x] v3 Consumers need as_view() equivalent. (Issue: #1531 PR: #1532)
- [x] Update documentation. 
- [x] Deprecate `AsgiHandler` & not specifying `"http"` key to `ProtocolTypeHandler` #1541
- [x] Simplify BaseMiddleware #1535
- [x] Daphe https://github.com/django/daphne/pull/275 ?
- [x] channels_redis https://github.com/django/channels_redis/pull/228
- [ ] What else...?


Discussion:

Resolving patch:
diff --git a/channels/__init__.py b/channels/__init__.py
--- a/channels/__init__.py
+++ b/channels/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "2.4.0"
+__version__ = "3.0.0"
 
 try:
     import django


Test patch:
Repository: django/channels

Issue:
type in deploying.rst
I believe there is a typo in deploying.rst

after
"http": get_asgi_application()

there should be a comma


```
import os

from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.conf.urls import url
from django.core.asgi import get_asgi_application

from chat.consumers import AdminChatConsumer, PublicChatConsumer

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")

application = ProtocolTypeRouter({
    # Django's ASGI application to handle traditional HTTP requests
    "http": get_asgi_application() ------ syntax error in dictionary? ----

    # WebSocket chat handler
    "websocket": AuthMiddlewareStack(
        URLRouter([
            url(r"^chat/admin/$", AdminChatConsumer.as_asgi()),
            url(r"^chat/$", PublicChatConsumer.as_asgi()),
        ])
    ),
})
```


Discussion:

Resolving patch:
diff --git a/channels/__init__.py b/channels/__init__.py
--- a/channels/__init__.py
+++ b/channels/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "3.0.0"
+__version__ = "3.0.1"
 
 try:
     import django


Test patch:
Repository: django/channels

Issue:
Django 4.0: ImportError: cannot import name 'LANGUAGE_SESSION_KEY' from 'django.utils.translation'
Thank you for the ongoing work of maintaining Channels! Here's an issue from recent changes to Django master.

- Your OS and runtime environment, and browser if applicable
Django master (4.0). (Ubuntu 20.04, Python 3.8.5)

- How you're running Channels (runserver? daphne/runworker? Nginx/Apache in front?)
runserver

- Console logs and full tracebacks of any errors
```
January 14, 2021 - 15:15:53
Django version 4.0, using settings 'myproject.settings'
Starting ASGI/Channels version 3.0.3 development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "channels/routing.py", line 28, in get_default_application
    module = importlib.import_module(path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "myproject/myproject/asgi.py", line 4, in <module>
    from channels.auth import AuthMiddlewareStack
  File "channels/auth.py", line 15, in <module>
    from django.utils.translation import LANGUAGE_SESSION_KEY
ImportError: cannot import name 'LANGUAGE_SESSION_KEY' from 'django.utils.translation' (django/utils/translation/__init__.py)

```


Discussion:
this library still don't support django 3.2 or master yet
It worked for me just to put `LANGUAGE_SESSION_KEY = '_language'` at the top of `channels/auth.py` as a workaround. Everything else is working fine for me on django master.
Super, thanks @collinanderson! I'll cut back here after the alpha and have a look at the proper solution. 
Thanks for the report. 

Resolving patch:
diff --git a/channels/auth.py b/channels/auth.py
--- a/channels/auth.py
+++ b/channels/auth.py
@@ -12,7 +12,6 @@
 from django.contrib.auth.models import AnonymousUser
 from django.utils.crypto import constant_time_compare
 from django.utils.functional import LazyObject
-from django.utils.translation import LANGUAGE_SESSION_KEY
 
 from channels.db import database_sync_to_async
 from channels.middleware import BaseMiddleware
@@ -126,11 +125,7 @@ def logout(scope):
         user = None
     if user is not None:
         user_logged_out.send(sender=user.__class__, request=None, user=user)
-    # remember language choice saved to session
-    language = session.get(LANGUAGE_SESSION_KEY)
     session.flush()
-    if language is not None:
-        session[LANGUAGE_SESSION_KEY] = language
     if "user" in scope:
         scope["user"] = AnonymousUser()
 


Test patch:
Repository: django/channels

Issue:
Test failures with in-memory layer. 
```
tests/test_inmemorychannel.py::test_send_receive FAILED                                                                                              [ 65%]
tests/test_inmemorychannel.py::test_send_capacity FAILED                                                                                            [ 67%]
tests/test_inmemorychannel.py::test_process_local_send_receive FAILED                                                                    [ 68%]

...
E       AttributeError: 'AsyncGenerator' object has no attribute 'send'
```

This has recently popped up. e.g. https://github.com/django/channels/actions/runs/770786127

It's a change in `pytest-asyncio` from 0.14.0 to 0.15.0



Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@
         'tests': [
             "pytest",
             "pytest-django",
-            "pytest-asyncio",
+            "pytest-asyncio==0.14.0",
             "async_generator",
             "async-timeout",
             "coverage~=4.5",


Test patch:
Repository: django/channels

Issue:
Drop Python 3.6 support. 
asgiref 3.5.0 dropped support for PY36. Time to follow suit for the next version. 


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@
     license='BSD',
     packages=find_packages(exclude=['tests']),
     include_package_data=True,
-    python_requires='>=3.6',
+    python_requires='>=3.7',
     install_requires=[
         'Django>=2.2',
         'asgiref>=3.3.1,<4',
@@ -34,7 +34,6 @@
         'Operating System :: OS Independent',
         'Programming Language :: Python',
         'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: 3.8',
         'Programming Language :: Python :: 3.9',


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -14,7 +14,6 @@ jobs:
       fail-fast: false
       matrix:
         python-version:
-        - "3.6"
         - "3.7"
         - "3.8"
         - "3.9"
Repository: django/channels

Issue:
Current version on Pypi is incompatible with Django 4.0+
The current version available on Pypi, channels-3.0.4 still use the providing_args keyword for signals.
Since this keyword has been removed from Django 4.0+ (December 2021), you cannot use channels with an up-to-date Django.

Is a version 3.0.5 planned for Pypi? 


Discussion:

Resolving patch:
diff --git a/channels/__init__.py b/channels/__init__.py
--- a/channels/__init__.py
+++ b/channels/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "3.0.4"
+__version__ = "3.0.5"
 
 try:
     import django


Test patch:
Repository: django/channels

Issue:
Improve BaseMiddleware class docstring
The class docstring of [BaseMiddleware](https://github.com/django/channels/blob/master/channels/middleware.py#L3) should be updated to explain that `__call__` (and `__init__`) must be changed for the middleware.

>  Base class for implementing ASGI middleware. Inherit from this and
>  override the setup() method if you want to do things before you
>  get to.

Also the purpose of the middlewares could also added to the docstring that they add additional information's in the scope with a reference to the ASGI reference or channels documentation (consumers scope section). This would help to understand the purpose of this to new users, what they can expect from the middlewares and what not.


Discussion:
Sure, very confusing that suggestion to override the setup() method which one is never invoked at all.

Resolving patch:
diff --git a/channels/middleware.py b/channels/middleware.py
--- a/channels/middleware.py
+++ b/channels/middleware.py
@@ -1,8 +1,6 @@
 class BaseMiddleware:
     """
-    Base class for implementing ASGI middleware. Inherit from this and
-    override the setup() method if you want to do things before you
-    get to.
+    Base class for implementing ASGI middleware.
 
     Note that subclasses of this are not self-safe; don't store state on
     the instance, as it serves multiple application instances. Instead, use


Test patch:
Repository: django/channels

Issue:
Breakage in routing.py on django/main pre-5.1. 
See Django issue: [#35338 (Behaviour Change in URL Patterns.) – Django](https://code.djangoproject.com/ticket/35338#ticket)
Example CI run: https://github.com/django/channels/actions/runs/8467612542/job/23198786518#step:5:342

In `URLRouter.__call__()`, `match = route.pattern.match(path)` is no longer matching. 


Discussion:

Resolving patch:
diff --git a/channels/routing.py b/channels/routing.py
--- a/channels/routing.py
+++ b/channels/routing.py
@@ -3,7 +3,7 @@
 from django.conf import settings
 from django.core.exceptions import ImproperlyConfigured
 from django.urls.exceptions import Resolver404
-from django.urls.resolvers import URLResolver
+from django.urls.resolvers import RegexPattern, RoutePattern, URLResolver
 
 """
 All Routing instances inside this file are also valid ASGI applications - with
@@ -87,7 +87,14 @@ def __init__(self, routes):
             # The inner ASGI app wants to do additional routing, route
             # must not be an endpoint
             if getattr(route.callback, "_path_routing", False) is True:
-                route.pattern._is_endpoint = False
+                pattern = route.pattern
+                if isinstance(pattern, RegexPattern):
+                    arg = pattern._regex
+                elif isinstance(pattern, RoutePattern):
+                    arg = pattern._route
+                else:
+                    raise ValueError(f"Unsupported pattern type: {type(pattern)}")
+                route.pattern = pattern.__class__(arg, pattern.name, is_endpoint=False)
 
             if not route.callback and isinstance(route, URLResolver):
                 raise ImproperlyConfigured(


Test patch: