Skip to content

Commit

Permalink
address reviewer comments
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermeleobas committed Jun 12, 2023
1 parent 17f2e70 commit 41ea6ac
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 98 deletions.
22 changes: 1 addition & 21 deletions .github/workflows/rbc_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ jobs:
llvm-version: ['11.1']
heavydb-from: [conda]
include:
- os: ubuntu-latest
python-version: '3.11'
numba-version: '0.57'
llvm-version: '14'
heavydb-version: '6.2' # if changing this value, update the condition
# on "Run rbc tests [LLVM mismatch]"
heavydb-from: conda
- os: ubuntu-latest
python-version: '3.11'
numba-version: '0.57'
Expand Down Expand Up @@ -249,7 +242,7 @@ jobs:
- name: Run rbc tests [conda]
shell: bash -l {0}
if: matrix.heavydb-from == 'conda' && ! (matrix.numba-version == '0.57' && matrix.heavydb-version == '6.2')
if: matrix.heavydb-from == 'conda'
env:
HEAVYDB_SOURCE: ${{ matrix.heavydb-from }}
EXPECTED_PYTHON_VERSION: ${{ matrix.python-version }}
Expand All @@ -261,19 +254,6 @@ jobs:
pkill -f heavydb
mamba run -n rbc pytest -sv -r A rbc/tests/ -x --ignore rbc/tests/heavydb
- name: Run rbc tests [LLVM mismatch]
shell: bash -l {0}
if: matrix.numba-version == '0.57' && matrix.heavydb-version == '6.2'
env:
HEAVYDB_SOURCE: ${{ matrix.heavydb-from }}
EXPECTED_PYTHON_VERSION: ${{ matrix.python-version }}
EXPECTED_HEAVYDB_VERSION: ${{ matrix.heavydb-version }}
EXPECTED_NUMBA_VERSION: ${{ matrix.numba-version }}
RBC_TESTS_FULL: TRUE
run: |
mamba run -n rbc pytest -sv -r A rbc/tests/heavydb/test_heavydb.py -k test_numba_heavydb_llvm_mismatch
- name: Show Heavydb conda logs on failure [conda]
shell: bash -l {0}
if: failure() && matrix.os == 'ubuntu-latest' && matrix.heavydb-from == 'conda'
Expand Down
6 changes: 0 additions & 6 deletions doc/envvars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,3 @@ Debugging

If set to non-zero, insert debug statements to our implementation
of Numba Runtime (NRT)

.. envvar:: DISABLE_LLVM_MISMATCH_WARN

If set to non-zero, RBC will not raise a warning on Numba/HeavyDB LLVM
mismatch version. Numba 0.57 uses LLVM 14 and may produce IR that
older versions of HeavyDB (< 7.0) cannot read.
28 changes: 0 additions & 28 deletions rbc/heavydb/remoteheavydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from rbc.targetinfo import TargetInfo
from rbc.irtools import compile_to_LLVM
from rbc.errors import ForbiddenNameError, HeavyDBServerError
from rbc.warnings import LLVMVersionMismatchWarning
from rbc.utils import parse_version, version_date
from rbc import ctools, typesystem

Expand Down Expand Up @@ -1268,35 +1267,8 @@ def _make_udf(self, caller, orig_sig, sig):
name + sig.mangling(),
atypes, rtype, annotations)

def _check_llvm_version(self):
# check LLVM version before compiling to LLVM
flag_name = 'RBC_DISABLE_LLVM_MISMATCH_WARN'
flag = int(os.environ.get(flag_name, False))

if not flag:
target = self.targets['cpu']
server_llvm_version = target.llvm_version
client_llvm_version = llvm.llvm_version_info

if (server_llvm_version[0], client_llvm_version[0]) == (11, 14):
c_llvm = '.'.join(map(str, client_llvm_version))
s_llvm = '.'.join(map(str, server_llvm_version))
msg = (
f'The client LLVM version ({c_llvm}) is greater than the server '
f'LLVM version ({s_llvm}). This is known to be unsupported. '
'Please, downgrade to a previous release of Numba that uses the '
'same LLVM version as the HeavyDB server. For more information, '
'see the table below:\n\n'
'https://github.com/numba/llvmlite#compatibility\n'
'https://github.com/heavyai/heavydb#dependencies\n\n'
f'To suppress this warning, run RBC with {flag_name}=1 '
'flag enabled.')
warnings.warn(msg, LLVMVersionMismatchWarning)

def register(self):
"""Register caller cache to the server."""
self._check_llvm_version()

with typesystem.Type.alias(**self.typesystem_aliases):
return self._register()

Expand Down
2 changes: 0 additions & 2 deletions rbc/irtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def _get_host_cpu_features(self):
'prefetchwt1', 'f16c', 'ssse3', 'sgx', 'shstk', 'cmov',
'avx512vbmi', 'amxint8', 'movbe', 'avx512vp2intersect',
'xsaveopt', 'avx512dq', 'sse2', 'adx', 'sse3'],
(14, 11): ['crc32', 'uintr', 'widekl', 'avxvnni', 'avx512fp16', 'kl',
'hreset'],
(11, 8): ['tsxldtrk', 'amx-tile', 'amx-bf16', 'serialize', 'amx-int8',
'avx512vp2intersect', 'tsxldtrk', 'amx-tile', 'amx-bf16',
'serialize', 'amx-int8', 'avx512vp2intersect', 'tsxldtrk',
Expand Down
34 changes: 0 additions & 34 deletions rbc/tests/heavydb/test_heavydb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import numpy as np
import pytest

from rbc.warnings import LLVMVersionMismatchWarning
from rbc.errors import HeavyDBServerError, UnsupportedError
from rbc.tests import assert_equal, heavydb_fixture
from rbc.typesystem import Type
Expand Down Expand Up @@ -875,36 +874,3 @@ def rbc_test_non_admin_user_udf(x):
# clean up:
heavydb.sql_execute(f'DROP DATABASE IF EXISTS {dbname};')
heavydb.sql_execute(f'DROP USER IF EXISTS "{user}";')


@pytest.mark.parametrize('kind', ('udf', 'udtf'))
def test_numba_heavydb_llvm_mismatch(heavydb, kind):
heavydb.reset()

# only run this test on a specific environment
target_info = heavydb.targets['cpu']
server_llvm_version = target_info.llvm_version
client_llvm_version = llvm.llvm_version_info

if (server_llvm_version[0], client_llvm_version[0]) != (11, 14):
c_llvm = '.'.join(map(str, client_llvm_version))
s_llvm = '.'.join(map(str, server_llvm_version))
msg = (f'Test requires server LLVM 14, got {s_llvm}. And client LLVM '
f'11, got {c_llvm}')
pytest.skip(msg)

if kind == 'udf':
@heavydb('int32(int32)')
def add(a):
return a + 1
else:
@heavydb('int32(TableFunctionManager, Column<int>, OutputColumn<int>)')
def column_copy(mgr, inp, out):
size = len(inp)
mgr.set_output_row_size(size)
for i in range(size):
out[i] = inp[i]
return size

with pytest.warns(LLVMVersionMismatchWarning):
heavydb.register()
7 changes: 0 additions & 7 deletions rbc/warnings.py

This file was deleted.

0 comments on commit 41ea6ac

Please sign in to comment.