I am using NVIDIA RTX-2060 (with turing cores) for deep learning model training. As mentioned on online forums enabling mix precision training helps turing architecture cards train faster than without mix precision training. When i enabled mix precision training, the per step time increased instead of getting decreased. I can't fathom why this is happening, i'd really appreciate anyone suggesting a solution. I've spent so much money buying this gpu, it's no use if i can't get it to train models faster.
Code:
import tensorflow as tf
def create_model():
model = keras.Sequential([
keras.layers.Flatten(input_shape=(32,32,3)),
keras.layers.Dense(3000, activation='relu'),
keras.layers.Dense(1000, activation='relu'),
keras.layers.Dense(10, activation='sigmoid')
])
model.compile(optimizer= 'SDG',
loss= 'categorical_crossentropy',
metrics=['accuracy'])
return model
tf.keras.mixed_precision.set_global_policy('mixed_float16')
%%timeit -n1 -r1 # time required toexecute this cell once
model = create_model()
model.fit(X_train_scaled, y_train_categorical, epochs=50)
Things You Must Know:
I have installed cuda and cudnn successfuly and tensorflow can detect my gpu.
I have installed tensorflow-gpu.
I am training my model on ciphar10 data set with nvidia rtx 2060 gpu.
Jupyter Notebook i've been using to benchmark: Link