Skip to content

Instantly share code, notes, and snippets.

View emfomenk's full-sized avatar
💭
dango dango

Evarist emfomenk

💭
dango dango
  • Hillsboro, Oregon
View GitHub Profile
@emfomenk
emfomenk / gh671.cpp
Created June 5, 2020 23:44
BF16 gemm-like API
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <mutex>
#include <vector>
#include <type_traits>
#include "dnnl.hpp"
#include <stdio.h>
#include <chrono>
#include <assert.h>
#include "dnnl.hpp"
using namespace dnnl;
void convolution_param(engine eng, dnnl::memory user_src_memory, int batch, int channel, int height, int width,dnnl::memory user_weights_memory, int no_of_filter, int kernel_h, int kernel_w, int pad_h,int pad_w, int stride_h, int stride_w, dnnl::memory conv1_user_bias_memory,dnnl::memory conv1_dst_memory, int out_height, int out_width) {
@emfomenk
emfomenk / gpu_ref_sum.patch
Created April 18, 2020 00:45
ref gpu sum patch
commit 7cb078d0f5b27957074695a7fe92f0103fb713b7
Author: Fomenko, Evarist M <evarist.m.fomenko@intel.com>
Date: Sat Apr 18 00:42:00 2020 +0000
gpu: ocl: sum: fix accuracy loss for non-f32 sum
diff --git a/src/gpu/ocl/ref_sum.hpp b/src/gpu/ocl/ref_sum.hpp
index ed927d338..451f58348 100644
--- a/src/gpu/ocl/ref_sum.hpp
+++ b/src/gpu/ocl/ref_sum.hpp
/*******************************************************************************
* Copyright 2019-2020 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@emfomenk
emfomenk / gh672.cpp
Created March 20, 2020 04:41
Play with uninitialized memory
#define _XOPEN_SOURCE 700
#include <sys/types.h>
#include <fcntl.h> /* open */
#include <stdint.h> /* uint64_t */
#include <stdio.h> /* printf */
#include <stdlib.h> /* size_t */
#include <unistd.h> /* pread, sysconf */
#include <sys/mman.h>
#include <malloc.h>
diff --git a/src/cpu/simple_concat.cpp b/src/cpu/simple_concat.cpp
index 6ec59629e..e4525c81b 100644
--- a/src/cpu/simple_concat.cpp
+++ b/src/cpu/simple_concat.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*******************************************************************************/
+#include <cstring>
+
@emfomenk
emfomenk / 0001-common-return-the-original-behavior-of-sub-memory.patch
Created November 29, 2019 09:36
fix for mkl-dnn/#608: common: return the original behavior of sub-memory
From abca9ca2329c5eeaa92a05b3d8d09a1629e2e62e Mon Sep 17 00:00:00 2001
From: "Fomenko, Evarist M" <evarist.m.fomenko@intel.com>
Date: Fri, 29 Nov 2019 09:13:55 +0000
Subject: [PATCH] common: return the original behavior of sub-memory
The unwanted change appeared with recent MatMul enabling, namely with
the run-time dimensions support. In order to retrieve the run-time sizes
and strides, the primitives started using memory descriptors from the
memory arguments instead of the memory descriptors kept in the primitive
descriptor.
@emfomenk
emfomenk / 0001-cpu-concat-include-padded-dims-when-computing-the-ph.patch
Created November 29, 2019 08:12
fix for mkl-dnn/#606: cpu: concat: include padded dims when computing the physical tensor size
From ed11371ba3c9e546aeb72cf6636dd36ccabbaf5f Mon Sep 17 00:00:00 2001
From: "Fomenko, Evarist M" <evarist.m.fomenko@intel.com>
Date: Fri, 29 Nov 2019 08:07:27 +0000
Subject: [PATCH] cpu: concat: include padded dims when computing the physical
tensor size
this closes #606
---
src/cpu/simple_concat.cpp | 2 +-
src/cpu/simple_concat.hpp | 2 +-
From 2484a4c3fe1fcab77b9e872737ededd41e8a61de Mon Sep 17 00:00:00 2001
From: "Fomenko, Evarist M" <evarist.m.fomenko@intel.com>
Date: Mon, 11 Nov 2019 14:38:25 -0800
Subject: [PATCH] build: retrieve TBB include dir location from properties
This allows using open source TBB using:
cmake -DTBB_DIR=/path/to/TBBConfig.cmake ..
---
cmake/TBB.cmake | 20 ++++++++++++++++++--
cmake/lnx/TBBConfig.cmake | 13 -------------
@emfomenk
emfomenk / ip.cpp
Last active June 27, 2019 14:45
simple inner product example (related to https://github.com/intel/mkl-dnn/issues/499)
#include <iostream>
#include <vector>
#include <mkldnn.hpp>
using namespace std;
using namespace mkldnn;
using tag = memory::format_tag;
using dt = memory::data_type;
int main(int argc, char *argv[]) {