Skip to content
This repository was archived by the owner on Apr 28, 2023. It is now read-only.
This repository was archived by the owner on Apr 28, 2023. It is now read-only.

Indexing with byte arrays. #511

Description

@mdouze
  • OS: Linux
  • How you installed TC (docker, conda, source): conda
  • Python version: 3.6.5
  • CUDA/cuDNN version: N/A
  • Conda version (if using conda): 4.5.0

In addition, including the following information will also be very helpful for us to diagnose the problem:

  • A script to reproduce the issue (highly recommended if its a build issue)
import tensor_comprehensions as tc
import numpy as np
import torch

N = 10 ** 7
M = 32

codes = np.random.randint(1<<32, size=(N, M // 4)).astype('uint32')
codes = codes.view('uint8')

codes_t = torch.from_numpy(codes)

luts = np.random.randn(M, 256).astype('float32')
luts_t = torch.from_numpy(luts)

lang = """
def mindis(float(M, 256) L, uint8(N, M) codes) -> (v, s) {
    s(i) +=! L(j, codes(i, j))
    v min=! s(i)
}
"""

mindis = tc.define(lang, name="mindis")

vmin = mindis(luts_t, codes_t)
  • Error messages and/or stack traces of the issue (create a gist)
[WARNING]: No mapping options passed, 'naive' type mapping options will be used and will likely have bad performance. See help(your_layer.__call__) for setting mapping options.
[ERROR]: Caught Exception: Internal error at /opt/conda/conda-bld/halide_1520457560724/work/src/IR.cpp:560
Condition failed: args[i].type() == Int(32)
Args to load from image must be type Int(32)
  • Context around what you are trying to do

This code is to find the min value of a distance estimation with a large number of Product Quantization codes.
The problems in the code above are:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions