Skip to content

Conversation

@graemenail
Copy link
Owner

@graemenail graemenail commented May 17, 2022

TODO

  • Manual check of training / scoring

Description

Replaces MKL with oneDNN. This PR should enable completely open-source releases of Marian.

This PR also includes a caching of boost, and a cleaning of the debug build directory. These can be broken off into a separate PR if necessary. During testing, windows builds would fail from running out of space building both debug and release. Since disabling oneDNN JIT profiling the build sizes are smaller.

Related: marian-nmt/marian-regression-tests#86

List of changes:

  • Adds oneDNN as a submodule
  • Removes MKL related code
  • Use oneDNN for sgemm
  • Modified code paths:
    • batched GEMM (cblas_sgemm_batch in prod.cpp)
    • TransposeFirst3In4 (mkl_somatcopy in tensor_operators.cpp)
    • Bias copy-op (mkl_somatcopy in packed_gemm.cpp)

The following have some MKL component, and have not been touched:

  • azure workflows
  • src/microsoft code
  • vs/*

Added dependencies: Intel oneDNN (removing Intel MKL)

How to test

Ran the 1 million sentence testset of WNGT21 through the MKL (4672.1s) and oneDNN (3918.9s) versions.

Using the wngt19 model from regression tests.

Setup
relative-paths: true
models:
  - wngt19/model.base.npz
vocabs:
  - wngt19/en-de.spm
  - wngt19/en-de.spm
normalize: 0.6
beam-size: 1
mini-batch: 128
maxi-batch: 100
maxi-batch-sort: src
cpu-threads: 16

Ran #cpu tagged regression tests. Non-intgemm tests pass.

Regression test results
Skipped:
- tests/models/wngt19/test_model_base_fbgemm_packed16.sh
- tests/models/wngt19/test_model_base_fbgemm_packed8.sh
- tests/server/test_ende_cpu.sh
Failed:
- tests/decoder/intgemm/test_intgemm_16bit.sh
- tests/decoder/intgemm/test_intgemm_16bit_avx2.sh
- tests/decoder/intgemm/test_intgemm_16bit_sse2.sh
- tests/decoder/intgemm/test_intgemm_8bit.sh
- tests/decoder/intgemm/test_intgemm_8bit_avx2.sh
- tests/decoder/intgemm/test_intgemm_8bit_ssse3.sh
Logs:
- /home/gnail/dev/marian-dev/regression-tests/tests/decoder/intgemm/test_intgemm_16bit.sh.log
- /home/gnail/dev/marian-dev/regression-tests/tests/decoder/intgemm/test_intgemm_16bit_avx2.sh.log
- /home/gnail/dev/marian-dev/regression-tests/tests/decoder/intgemm/test_intgemm_16bit_sse2.sh.log
- /home/gnail/dev/marian-dev/regression-tests/tests/decoder/intgemm/test_intgemm_8bit.sh.log
- /home/gnail/dev/marian-dev/regression-tests/tests/decoder/intgemm/test_intgemm_8bit_avx2.sh.log
- /home/gnail/dev/marian-dev/regression-tests/tests/decoder/intgemm/test_intgemm_8bit_ssse3.sh.log
---------------------
Ran 19 tests in 00:03:6.267s, 10 passed, 3 skipped, 6 failed
FAILED

The static binaries are now larger.

Checklist

  • I have tested the code manually
  • I have run regression tests
  • I have read and followed CONTRIBUTING.md
  • I have updated CHANGELOG.md

@graemenail graemenail force-pushed the onednn branch 2 times, most recently from 2239ba1 to 27a35b5 Compare June 3, 2022 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants