I have a rtx 2080ti and i am training this model.

import time
start = time.time()
epochs = 40
for epoch in range(epochs):
train_accuracy = 0
count = 0
accumulated_loss = 0
for train_in,train_label in tqdm(batch(X_train,Y_train)):
#print(train_in)
torch.cuda.synchronize()
output = model(train_in.to(device))
#print(output.shape)
output = output.squeeze(1)
#print(output.shape)
train_label = train_label.squeeze(-1)
loss = criterion(output,train_label.long().to(device))
#with amp.scale_loss(loss, optimizer) as scaled_loss:
#scaled_loss.backward()
loss.backward()
optimizer.step()
count += 1
train_accuracy += accuracy(output,train_label)
accumulated_loss += loss#scaled_loss
optimizer.zero_grad()
print('Training Epoch {} with Accuracy :{} Loss :{}'.format(epoch+1,train_accuracy/count,accumulated_loss/count))
with torch.no_grad():
    test_acc = 0
    test_count = 0
    for X_t,Y_t in tqdm(batch(X_test,Y_test)):
        test_output = model(X_t.to(device))
        test_output = test_output.squeeze(1)

        Y_t = Y_t.squeeze(-1)
        test_accuracy = accuracy(test_output,Y_t)
        test_acc += test_accuracy
        test_count += 1
        
print('Testing Epoch {} with Accuracy :{}'.format(epoch+1,test_acc/test_count))  

end = time.time()
print(“time equal {}”.format(end-start))

the running time for training without fp16 is 24 and with fp16 is nearly 32. This message appears to me when i check the setup of “apex” library:

Compiling cuda extensions with
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85
from /usr/bin
Traceback (most recent call last):
File “setup.py”, line 100, in 
check_cuda_torch_binary_vs_bare_metal(torch.utils.cpp_extension.CUDA_HOME)
File “setup.py”, line 77, in check_cuda_torch_binary_vs_bare_metal
"https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  "
RuntimeError: Cuda extensions are being compiled with a version of Cuda that does not match the >version used to compile Pytorch binaries.  Pytorch binaries were compiled with Cuda 10.1.
In some cases, a minor-version mismatch will not cause later errors:  >https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  You can try commenting out this >check (at your own risk).

I am using pytorch 1.4 , cuda 10.1. I know there is difference in cuda version , but is that the only problem ? And if there is a version difference how can the model train ?
Anybody help i have been in this for a very long time.
I am now download nvidia-toolkit cuda 10.1 and try to set it up maybe it will fix this.
Any clarification ?