Question: why knn is non parametric?
Answer: The definition you mentioned is correct. The reason why kNN is non-parametric is the model parameters actually grows with the training set - you can image each training instance as a "parameter" in the model, because they're the things you use during prediction. And, K should be considered as hyper-parameter in kNN.